Contract 0x845a7872d1cDe2B3285dE9f66B1D2EC70307cC6b 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf7966f74ff0770b8b8fd172e9d622a96db5ff3e8fce8262ce491669e85a91ba3Initialize61160042022-02-15 15:51:30833 days 14 hrs ago0xd8166138eda6defd2bf2403d7637f41ce01c4bbe IN  0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH0.000848574336 ETH0.559478782
0xd1b6b37657973a2c8e3be7644a3231654c7c2a9148a733ee79c1accd6e4d7f170x6080604061063972022-02-15 13:15:36833 days 17 hrs ago0xd8166138eda6defd2bf2403d7637f41ce01c4bbe IN  Create: Registry0 ETH0.018522110266 ETH0.547283602
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x995e809942d7f590bca5f8380f94e0bedca4624848a7bfaf4264296410c0c60f710283122023-03-18 8:20:22437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x995e809942d7f590bca5f8380f94e0bedca4624848a7bfaf4264296410c0c60f710283122023-03-18 8:20:22437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8aa0bef11ef224e6923cb19b128422b5486d176c622c59f199368b693c9b75de710182402023-03-18 7:38:18437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8aa0bef11ef224e6923cb19b128422b5486d176c622c59f199368b693c9b75de710182402023-03-18 7:38:18437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8aa0bef11ef224e6923cb19b128422b5486d176c622c59f199368b693c9b75de710182402023-03-18 7:38:18437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8aa0bef11ef224e6923cb19b128422b5486d176c622c59f199368b693c9b75de710182402023-03-18 7:38:18437 days 22 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x4eeedcc33c50e09fc421cebd73d5b21b4f685c6ff0860994defafad765aec51f672780312023-03-06 11:55:44449 days 18 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x4eeedcc33c50e09fc421cebd73d5b21b4f685c6ff0860994defafad765aec51f672780312023-03-06 11:55:44449 days 18 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x4eeedcc33c50e09fc421cebd73d5b21b4f685c6ff0860994defafad765aec51f672780312023-03-06 11:55:44449 days 18 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x4eeedcc33c50e09fc421cebd73d5b21b4f685c6ff0860994defafad765aec51f672780312023-03-06 11:55:44449 days 18 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0xa966550349668ceacadeb74bc25f2e0d2e0aa388ca5589cb312d9404317f9954602374552023-02-12 11:20:18471 days 19 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0xa966550349668ceacadeb74bc25f2e0d2e0aa388ca5589cb312d9404317f9954602374552023-02-12 11:20:18471 days 19 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x27d55f1c3a66238fa1eba90336e02198688c46f45f053849376771e4ffca5841586952012023-02-07 5:07:51477 days 1 hr ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x27d55f1c3a66238fa1eba90336e02198688c46f45f053849376771e4ffca5841586952012023-02-07 5:07:51477 days 1 hr ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x27d55f1c3a66238fa1eba90336e02198688c46f45f053849376771e4ffca5841586952012023-02-07 5:07:51477 days 1 hr ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x27d55f1c3a66238fa1eba90336e02198688c46f45f053849376771e4ffca5841586952012023-02-07 5:07:51477 days 1 hr ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0xa93efb873727f9aa2148f96ca57d44db4ab1df6caf460d1adaa2021229d0759a553936922023-01-25 15:47:00489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0xa93efb873727f9aa2148f96ca57d44db4ab1df6caf460d1adaa2021229d0759a553936922023-01-25 15:47:00489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x6634f0f0c87d8eb75bafa8ba485be7c0b92c0b0f6977288b4cfa330d4f80542d553895812023-01-25 15:23:49489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x6634f0f0c87d8eb75bafa8ba485be7c0b92c0b0f6977288b4cfa330d4f80542d553895812023-01-25 15:23:49489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x6634f0f0c87d8eb75bafa8ba485be7c0b92c0b0f6977288b4cfa330d4f80542d553895812023-01-25 15:23:49489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x6634f0f0c87d8eb75bafa8ba485be7c0b92c0b0f6977288b4cfa330d4f80542d553895812023-01-25 15:23:49489 days 14 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8cd869d9886256703f4857fa590cabd1d039a1fe454025a3e7028af59b302821463750632022-12-15 12:58:29530 days 17 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8cd869d9886256703f4857fa590cabd1d039a1fe454025a3e7028af59b302821463750632022-12-15 12:58:29530 days 17 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
0x8cd869d9886256703f4857fa590cabd1d039a1fe454025a3e7028af59b302821463750632022-12-15 12:58:29530 days 17 hrs ago Opium Network: Registry 0x845a7872d1cde2b3285de9f66b1d2ec70307cc6b0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Registry

Compiler Version
v0.8.5+commit.a4f2e591

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 19 : Registry.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "../../libs/LibRoles.sol";
import "../../libs/LibCalculator.sol";
import "../../interfaces/IOpiumProxyFactory.sol";
import "../../interfaces/ISyntheticAggregator.sol";
import "../../interfaces/IOracleAggregator.sol";
import "../../interfaces/ITokenSpender.sol";
import "../../interfaces/ICore.sol";

/**
    Error codes:
    - R1 = ERROR_REGISTRY_ONLY_PROTOCOL_ADDRESSES_SETTER_ROLE
    - R2 = ERROR_REGISTRY_ONLY_EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE
    - R3 = ERROR_REGISTRY_ONLY_REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE
    - R4 = ERROR_REGISTRY_ONLY_EXECUTION_RESERVE_PART_SETTER_ROLE
    - R5 = ERROR_REGISTRY_ONLY_NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE
    - R6 = ERROR_REGISTRY_ONLY_GUARDIAN_ROLE
    - R7 = ERROR_REGISTRY_ONLY_WHITELISTER_ROLE
    - R8 = ERROR_REGISTRY_ONLY_DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE
    - R9 = ERROR_REGISTRY_ONLY_REDEMPTION_RESERVE_PART_SETTER_ROLE
    - R10 = ERROR_REGISTRY_ALREADY_PAUSED
    - R11 = ERROR_REGISTRY_NOT_PAUSED
    - R12 = ERROR_REGISTRY_NULL_ADDRESS
    - R13 = ERROR_REGISTRY_ONLY_PARTIAL_CREATE_PAUSE_ROLE
    - R14 = ERROR_REGISTRY_ONLY_PARTIAL_MINT_PAUSE_ROLE
    - R15 = ERROR_REGISTRY_ONLY_PARTIAL_REDEEM_PAUSE_ROLE
    - R16 = ERROR_REGISTRY_ONLY_PARTIAL_EXECUTE_PAUSE_ROLE
    - R17 = ERROR_REGISTRY_ONLY_PARTIAL_CANCEL_PAUSE_ROLE
    - R18 = ERROR_REGISTRY_ONLY_PARTIAL_CLAIM_RESERVE_PAUSE_ROLE
    - R19 = ERROR_REGISTRY_ONLY_PROTOCOL_UNPAUSER_ROLE
    - R20 = ERROR_REGISTRY_INVALID_VALUE
 */

contract Registry is AccessControlUpgradeable {
    // Setup
    event LogNoDataCancellationPeriodChanged(address indexed _setter, uint256 indexed _noDataCancellationPeriod);
    event LogWhitelistAccountAdded(address indexed _setter, address indexed _whitelisted);
    event LogWhitelistAccountRemoved(address indexed _setter, address indexed _unlisted);
    // Reserve
    event LogProtocolExecutionReserveClaimerChanged(
        address indexed _setter,
        address indexed _protocolExecutionReserveClaimer
    );
    event LogProtocolRedemptionReserveClaimerChanged(
        address indexed _setter,
        address indexed _protocolRedemptionReserveClaimer
    );
    event LogProtocolExecutionReservePartChanged(address indexed _setter, uint32 indexed _protocolExecutionReservePart);
    event LogDerivativeAuthorExecutionFeeCapChanged(
        address indexed _setter,
        uint32 indexed _derivativeAuthorExecutionFeeCap
    );
    event LogProtocolRedemptionReservePartChanged(
        address indexed _setter,
        uint32 indexed _protocolRedemptionReservePart
    );
    event LogDerivativeAuthorRedemptionReservePartChanged(
        address indexed _setter,
        uint32 indexed _derivativeAuthorRedemptionReservePart
    );
    // Emergency
    // emits the role to signal what type of pause has been committed, if any
    event LogProtocolPausableStateChanged(address indexed _setter, bool indexed _state, bytes32 indexed _role);

    RegistryEntities.ProtocolParametersArgs private protocolParametersArgs;
    RegistryEntities.ProtocolAddressesArgs private protocolAddressesArgs;
    RegistryEntities.ProtocolPausabilityArgs private protocolPausabilityArgs;
    mapping(address => bool) private coreSpenderWhitelist;

    // ***** SETUP *****

    /// @notice it ensures that the calling account has been granted the PROTOCOL_ADDRESSES_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolAdressesSetter() {
        require(hasRole(LibRoles.PROTOCOL_ADDRESSES_SETTER_ROLE, msg.sender), "R1");
        _;
    }

    /// @notice it ensures that the calling account has been granted the NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyNoDataCancellationPeriodSetter() {
        require(hasRole(LibRoles.NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE, msg.sender), "R5");
        _;
    }

    /// @notice it ensures that the calling account has been granted the WHITELISTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyWhitelister() {
        require(hasRole(LibRoles.WHITELISTER_ROLE, msg.sender), "R7");
        _;
    }

    // ***** RESERVE *****

    /// @notice it ensures that the calling account has been granted the EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolExecutionReserveClaimerAddressSetter() {
        require(hasRole(LibRoles.EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE, msg.sender), "R2");
        _;
    }

    /// @notice it ensures that the calling account has been granted the REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolRedemptionReserveClaimerAddressSetter() {
        require(hasRole(LibRoles.REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE, msg.sender), "R3");
        _;
    }

    /// @notice it ensures that the calling account has been granted the EXECUTION_RESERVE_PART_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolExecutionReservePartSetter() {
        require(hasRole(LibRoles.EXECUTION_RESERVE_PART_SETTER_ROLE, msg.sender), "R4");
        _;
    }

    /// @notice it ensures that the calling account has been granted the DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyDerivativeAuthorExecutionFeeCapSetter() {
        require(hasRole(LibRoles.DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE, msg.sender), "R8");
        _;
    }

    /// @notice it ensures that the calling account has been granted the REDEMPTION_RESERVE_PART_SETTER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolRedemptionReservePartSetter() {
        require(hasRole(LibRoles.REDEMPTION_RESERVE_PART_SETTER_ROLE, msg.sender), "R9");
        _;
    }

    // ***** EMERGENCY *****

    /// @notice it ensures that the calling account has been granted the GUARDIAN_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyGuardian() {
        require(hasRole(LibRoles.GUARDIAN_ROLE, msg.sender), "R6");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_CREATE_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialCreatePauseSetter() {
        require(hasRole(LibRoles.PARTIAL_CREATE_PAUSE_ROLE, msg.sender), "R13");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_MINT_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialMintPauseSetter() {
        require(hasRole(LibRoles.PARTIAL_MINT_PAUSE_ROLE, msg.sender), "R14");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_REDEEM_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialRedeemPauseSetter() {
        require(hasRole(LibRoles.PARTIAL_REDEEM_PAUSE_ROLE, msg.sender), "R15");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_EXECUTE_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialExecutePauseSetter() {
        require(hasRole(LibRoles.PARTIAL_EXECUTE_PAUSE_ROLE, msg.sender), "R16");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_CANCEL_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialCancelPauseSetter() {
        require(hasRole(LibRoles.PARTIAL_CANCEL_PAUSE_ROLE, msg.sender), "R17");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PARTIAL_CLAIM_RESERVE_PAUSE_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyPartialClaimReservePauseSetter() {
        require(hasRole(LibRoles.PARTIAL_CLAIM_RESERVE_PAUSE_ROLE, msg.sender), "R18");
        _;
    }

    /// @notice it ensures that the calling account has been granted the PROTOCOL_UNPAUSER_ROLE
    /// @dev by default, it is granted to the `governor` account
    modifier onlyProtocolUnpauserSetter() {
        require(hasRole(LibRoles.PROTOCOL_UNPAUSER_ROLE, msg.sender), "R19");
        _;
    }

    // ****************** EXTERNAL FUNCTIONS ******************

    // ***** SETTERS *****

    /// @notice it is called only once upon deployment of the contract. It initializes the DEFAULT_ADMIN_ROLE with the given governor address.
    /// @notice it sets the default ProtocolParametersArgs protocol parameters
    /// @dev internally, it assigns all the setters roles to the DEFAULT_ADMIN_ROLE and it sets the initial protocol parameters
    /// @param _governor address of the governance account which will be assigned all the roles included in the LibRoles library and the OpenZeppelin AccessControl.DEFAULT_ADMIN_ROLE
    function initialize(address _governor) external initializer {
        __AccessControl_init();

        // Setup
        _setupRole(DEFAULT_ADMIN_ROLE, _governor);
        _setupRole(LibRoles.PROTOCOL_ADDRESSES_SETTER_ROLE, _governor);
        _setupRole(LibRoles.NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE, _governor);
        _setupRole(LibRoles.WHITELISTER_ROLE, _governor);
        _setupRole(LibRoles.REGISTRY_MANAGER_ROLE, _governor);
        _setupRole(LibRoles.CORE_CONFIGURATION_UPDATER_ROLE, _governor);

        // Reserve
        _setupRole(LibRoles.EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE, _governor);
        _setupRole(LibRoles.REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE, _governor);
        _setupRole(LibRoles.EXECUTION_RESERVE_PART_SETTER_ROLE, _governor);
        _setupRole(LibRoles.DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE, _governor);
        _setupRole(LibRoles.REDEMPTION_RESERVE_PART_SETTER_ROLE, _governor);

        // Emergency
        _setupRole(LibRoles.GUARDIAN_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_CREATE_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_MINT_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_REDEEM_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_EXECUTE_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_CANCEL_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PARTIAL_CLAIM_RESERVE_PAUSE_ROLE, _governor);
        _setupRole(LibRoles.PROTOCOL_UNPAUSER_ROLE, _governor);

        // Default protocol parameters
        protocolParametersArgs.noDataCancellationPeriod = 2 weeks;
        protocolParametersArgs.derivativeAuthorExecutionFeeCap = 1000; // 10%
        protocolParametersArgs.derivativeAuthorRedemptionReservePart = 10; // 0.1%
        protocolParametersArgs.protocolExecutionReservePart = 1000; // 10%
        protocolParametersArgs.protocolRedemptionReservePart = 1000; // 10%
    }

    // ** ROLE-RESTRICTED FUNCTIONS **

    // * Setup *

    /// @notice It allows the PROTOCOL_ADDRESSES_SETTER_ROLE role to set the addresses of Opium Protocol's contracts
    /// @dev It must be called as part of the protocol's deployment setup after the core addresses have been deployed
    /// @dev the contracts' addresses are set using their respective interfaces
    /// @param _opiumProxyFactory address of Opium.OpiumProxyFactory
    /// @param _core address of Opium.Core
    /// @param _oracleAggregator address of Opium.OracleAggregator
    /// @param _syntheticAggregator address of Opium.SyntheticAggregator
    /// @param _tokenSpender address of Opium.TokenSpender
    function setProtocolAddresses(
        address _opiumProxyFactory,
        address _core,
        address _oracleAggregator,
        address _syntheticAggregator,
        address _tokenSpender
    ) external onlyProtocolAdressesSetter {
        require(
            _opiumProxyFactory != address(0) &&
                _core != address(0) &&
                _oracleAggregator != address(0) &&
                _syntheticAggregator != address(0) &&
                _tokenSpender != address(0),
            "R12"
        );
        protocolAddressesArgs.opiumProxyFactory = _opiumProxyFactory;
        protocolAddressesArgs.core = _core;
        protocolAddressesArgs.oracleAggregator = _oracleAggregator;
        protocolAddressesArgs.syntheticAggregator = _syntheticAggregator;
        protocolAddressesArgs.tokenSpender = _tokenSpender;
    }

    /// @notice It allows the NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE role to change the noDataCancellationPeriod (the timeframe after which a derivative can be cancelled if the oracle has not provided any data)
    function setNoDataCancellationPeriod(uint32 _noDataCancellationPeriod) external onlyNoDataCancellationPeriodSetter {
        protocolParametersArgs.noDataCancellationPeriod = _noDataCancellationPeriod;
        emit LogNoDataCancellationPeriodChanged(msg.sender, _noDataCancellationPeriod);
    }

    /// @notice It allows the WHITELISTER_ROLE to add an address to the whitelist
    function addToWhitelist(address _whitelisted) external onlyWhitelister {
        coreSpenderWhitelist[_whitelisted] = true;
        emit LogWhitelistAccountAdded(msg.sender, _whitelisted);
    }

    /// @notice It allows the WHITELISTER_ROLE to remove an address from the whitelist
    function removeFromWhitelist(address _whitelisted) external onlyWhitelister {
        coreSpenderWhitelist[_whitelisted] = false;
        emit LogWhitelistAccountRemoved(msg.sender, _whitelisted);
    }

    // * Reserve *

    /// @notice It allows the EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE role to change the address of the recipient of execution protocol reserves
    /// @dev It must be called as part of the protocol's deployment setup after the core addresses have been deployed
    /// @dev it must be a non-null address
    /// @param _protocolExecutionReserveClaimer address that will replace the current `protocolExecutionReserveClaimer`
    function setProtocolExecutionReserveClaimer(address _protocolExecutionReserveClaimer)
        external
        onlyProtocolExecutionReserveClaimerAddressSetter
    {
        require(_protocolExecutionReserveClaimer != address(0), "R12");
        protocolAddressesArgs.protocolExecutionReserveClaimer = _protocolExecutionReserveClaimer;
        emit LogProtocolExecutionReserveClaimerChanged(msg.sender, _protocolExecutionReserveClaimer);
    }

    /// @notice It allows the REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE role to change the address of the recipient of redemption protocol reserves
    /// @dev It must be called as part of the protocol's deployment setup after the core addresses have been deployed
    /// @dev it must be a non-null address
    /// @param _protocolRedemptionReserveClaimer address that will replace the current `protocolAddressesArgs.protocolRedemptionReserveClaimer`
    function setProtocolRedemptionReserveClaimer(address _protocolRedemptionReserveClaimer)
        external
        onlyProtocolRedemptionReserveClaimerAddressSetter
    {
        require(_protocolRedemptionReserveClaimer != address(0), "R12");
        protocolAddressesArgs.protocolRedemptionReserveClaimer = _protocolRedemptionReserveClaimer;
        emit LogProtocolRedemptionReserveClaimerChanged(msg.sender, _protocolRedemptionReserveClaimer);
    }

    /// @notice It allows the EXECUTION_RESERVE_PART_SETTER_ROLE role to change part of derivative author reserves originated from derivative executions go to the protocol reserves
    /// @param _protocolExecutionReservePart must be less than 100%
    function setProtocolExecutionReservePart(uint32 _protocolExecutionReservePart)
        external
        onlyProtocolExecutionReservePartSetter
    {
        require(_protocolExecutionReservePart < LibCalculator.PERCENTAGE_BASE, "R20");
        protocolParametersArgs.protocolExecutionReservePart = _protocolExecutionReservePart;
        emit LogProtocolExecutionReservePartChanged(msg.sender, _protocolExecutionReservePart);
    }

    /// @notice It allows the DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE role to change max fee that derivative author can set
    /// @param _derivativeAuthorExecutionFeeCap must be less than 100%
    function setDerivativeAuthorExecutionFeeCap(uint32 _derivativeAuthorExecutionFeeCap)
        external
        onlyDerivativeAuthorExecutionFeeCapSetter
    {
        require(_derivativeAuthorExecutionFeeCap < LibCalculator.PERCENTAGE_BASE, "R20");
        protocolParametersArgs.derivativeAuthorExecutionFeeCap = _derivativeAuthorExecutionFeeCap;
        emit LogDerivativeAuthorExecutionFeeCapChanged(msg.sender, _derivativeAuthorExecutionFeeCap);
    }

    /// @notice It allows the REDEMPTION_RESERVE_PART_SETTER_ROLE role to change part of derivative author reserves originated from redemption of market neutral positions go to the protocol reserves
    /// @param _protocolRedemptionReservePart must be less than 100%
    function setProtocolRedemptionReservePart(uint32 _protocolRedemptionReservePart)
        external
        onlyProtocolRedemptionReservePartSetter
    {
        require(_protocolRedemptionReservePart < LibCalculator.PERCENTAGE_BASE, "R20");
        protocolParametersArgs.protocolRedemptionReservePart = _protocolRedemptionReservePart;
        emit LogProtocolRedemptionReservePartChanged(msg.sender, _protocolRedemptionReservePart);
    }

    /// @notice It allows the REDEMPTION_RESERVE_PART_SETTER_ROLE role to change the fixed part (percentage) that the derivative author receives for each redemption of market neutral positions
    /// @param _derivativeAuthorRedemptionReservePart must be less than 1%
    function setDerivativeAuthorRedemptionReservePart(uint32 _derivativeAuthorRedemptionReservePart)
        external
        onlyProtocolRedemptionReservePartSetter
    {
        require(_derivativeAuthorRedemptionReservePart <= LibCalculator.MAX_REDEMPTION_PART, "R20");
        protocolParametersArgs.derivativeAuthorRedemptionReservePart = _derivativeAuthorRedemptionReservePart;
        emit LogDerivativeAuthorRedemptionReservePartChanged(msg.sender, _derivativeAuthorRedemptionReservePart);
    }

    // * Emergency *

    /// @notice It allows the GUARDIAN role to pause the entire Opium Protocol
    /// @dev it fails if the entire protocol is already paused
    function pause() external onlyGuardian {
        require(!protocolPausabilityArgs.protocolGlobal, "R10");
        protocolPausabilityArgs.protocolGlobal = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.GUARDIAN_ROLE);
    }

    /// @notice It allows the PARTIAL_CREATE_PAUSE_ROLE role to pause the creation of positions
    /// @dev it fails if the creation of positions is paused
    function pauseProtocolPositionCreation() external onlyPartialCreatePauseSetter {
        require(!protocolPausabilityArgs.protocolPositionCreation, "R10");
        protocolPausabilityArgs.protocolPositionCreation = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_CREATE_PAUSE_ROLE);
    }

    /// @notice It allows the PARTIAL_MINT_PAUSE_ROLE role to pause the minting of positions
    /// @dev it fails if the minting of positions is paused
    function pauseProtocolPositionMinting() external onlyPartialMintPauseSetter {
        require(!protocolPausabilityArgs.protocolPositionMinting, "R10");
        protocolPausabilityArgs.protocolPositionMinting = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_MINT_PAUSE_ROLE);
    }

    /// @notice It allows the PARTIAL_REDEEM_PAUSE_ROLE role to pause the redemption of positions
    /// @dev it fails if the redemption of positions is paused
    function pauseProtocolPositionRedemption() external onlyPartialRedeemPauseSetter {
        require(!protocolPausabilityArgs.protocolPositionRedemption, "R10");
        protocolPausabilityArgs.protocolPositionRedemption = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_REDEEM_PAUSE_ROLE);
    }

    /// @notice It allows the PARTIAL_EXECUTE_PAUSE_ROLE role to pause the execution of positions
    /// @dev it fails if the execution of positions is paused
    function pauseProtocolPositionExecution() external onlyPartialExecutePauseSetter {
        require(!protocolPausabilityArgs.protocolPositionExecution, "R10");
        protocolPausabilityArgs.protocolPositionExecution = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_EXECUTE_PAUSE_ROLE);
    }

    /// @notice It allows the PARTIAL_CANCEL_PAUSE_ROLE role to pause the cancellation of positions
    /// @dev it fails if the cancellation of positions is paused
    function pauseProtocolPositionCancellation() external onlyPartialCancelPauseSetter {
        require(!protocolPausabilityArgs.protocolPositionCancellation, "R10");
        protocolPausabilityArgs.protocolPositionCancellation = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_CANCEL_PAUSE_ROLE);
    }

    /// @notice It allows the PARTIAL_CLAIM_RESERVE_PAUSE_ROLE role to pause the reserves claims
    /// @dev it fails if the reserves claims are paused
    function pauseProtocolReserveClaim() external onlyPartialClaimReservePauseSetter {
        require(!protocolPausabilityArgs.protocolReserveClaim, "R10");
        protocolPausabilityArgs.protocolReserveClaim = true;
        emit LogProtocolPausableStateChanged(msg.sender, true, LibRoles.PARTIAL_CLAIM_RESERVE_PAUSE_ROLE);
    }

    /// @notice It allows the PROTOCOL_UNPAUSER_ROLE to unpause the Opium Protocol
    function unpause() external onlyProtocolUnpauserSetter {
        delete protocolPausabilityArgs;
        emit LogProtocolPausableStateChanged(msg.sender, false, LibRoles.PROTOCOL_UNPAUSER_ROLE);
    }

    // ***** GETTERS *****

    ///@return RegistryEntities.getProtocolParameters struct that packs the protocol lifecycle parameters {see RegistryEntities comments}
    function getProtocolParameters() external view returns (RegistryEntities.ProtocolParametersArgs memory) {
        return protocolParametersArgs;
    }

    ///@return RegistryEntities.ProtocolAddressesArgs struct that packs all the interfaces of the Opium Protocol
    function getProtocolAddresses() external view returns (RegistryEntities.ProtocolAddressesArgs memory) {
        return protocolAddressesArgs;
    }

    /// @notice Returns true if msg.sender has been assigned the REGISTRY_MANAGER_ROLE role
    /// @dev it is meant to be consumed by the RegistryManager module
    /// @param _address address to be checked
    function isRegistryManager(address _address) external view returns (bool) {
        return hasRole(LibRoles.REGISTRY_MANAGER_ROLE, _address);
    }

    /// @notice Returns true if msg.sender has been assigned the CORE_CONFIGURATION_UPDATER_ROLE role
    /// @dev it is meant to be consumed by the RegistryManager module
    /// @param _address address to be checked
    function isCoreConfigurationUpdater(address _address) external view returns (bool) {
        return hasRole(LibRoles.CORE_CONFIGURATION_UPDATER_ROLE, _address);
    }

    /// @return `Opium.Core`
    function getCore() external view returns (address) {
        return address(protocolAddressesArgs.core);
    }

    /// @notice It returns whether a given address is allowed to manage Opium.Core ERC20 balances
    function isCoreSpenderWhitelisted(address _address) external view returns (bool) {
        return coreSpenderWhitelist[_address];
    }

    /// @notice It returns true if the protocol is globally paused
    function isProtocolPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal;
    }

    /// @notice It returns whether Core.create() is currently paused
    /// @return true if protocol is globally paused or if protocolPositionCreation is paused
    function isProtocolPositionCreationPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolPositionCreation;
    }

    /// @notice It returns whether Core.mint() is currently paused
    /// @return true if protocol is globally paused or if protocolPositionMinting is paused
    function isProtocolPositionMintingPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolPositionMinting;
    }

    /// @notice It returns whether Core.redeem() is currently paused
    /// @return true if protocol is globally paused or if protocolPositionRedemption is paused
    function isProtocolPositionRedemptionPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolPositionRedemption;
    }

    /// @notice It returns whether Core.execute() is currently paused
    /// @return true if protocol is globally paused or if protocolPositionExecution is paused
    function isProtocolPositionExecutionPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolPositionExecution;
    }

    /// @notice It returns whether Core.cancel() is currently paused
    /// @return true if protocol is globally paused or if protocolPositionCancellation is paused
    function isProtocolPositionCancellationPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolPositionCancellation;
    }

    /// @notice It returns whether Core.execute() is currently paused
    /// @return true if protocol is globally paused or if protocolReserveClaim is paused
    function isProtocolReserveClaimPaused() external view returns (bool) {
        return protocolPausabilityArgs.protocolGlobal || protocolPausabilityArgs.protocolReserveClaim;
    }

    // Reserved storage space to allow for layout changes in the future.
    uint256[50] private __gap;
}

File 2 of 19 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
    function __AccessControl_init() internal onlyInitializing {
        __Context_init_unchained();
        __ERC165_init_unchained();
        __AccessControl_init_unchained();
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        StringsUpgradeable.toHexString(uint160(account), 20),
                        " is missing role ",
                        StringsUpgradeable.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
    uint256[49] private __gap;
}

File 3 of 19 : LibRoles.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

library LibRoles {
    // ***** SETUP *****

    /// @notice Role responsible for updating the Opium Protocol core contracts' addresses encoded in the RegistryEntities.ProtocolAddressesArgs struct
    /// @dev { See RegistryEntities.sol for a detailed description of the struct }
    bytes32 internal constant PROTOCOL_ADDRESSES_SETTER_ROLE = keccak256("RL1");

    /// @notice Role responsible for updating the RegistryEntities.ProtocolParametersArgs.noDataCancellationPeriod
    /// @dev { See RegistryEntities.sol for a detailed description of the ProtocolParametersArgs parameters }
    bytes32 internal constant NO_DATA_CANCELLATION_PERIOD_SETTER_ROLE = keccak256("RL5");

    /// @notice Role responsible for managing (adding and removing accounts) the whitelist
    bytes32 internal constant WHITELISTER_ROLE = keccak256("RL7");

    /// @notice Role responsible for updating the Registry address itself stored in the Opium Protocol core contracts that consume the Registry
    /// @dev It is the only role whose associated setter does not reside in the Registry itself but in a module inherited by its consumer contracts.
    /// @dev The registry's sole responsibility is to keep track of the accounts that have been assigned to the REGISTRY_MANAGER_ROLE role
    /// @dev { See RegistryManager.sol for further details }
    bytes32 internal constant REGISTRY_MANAGER_ROLE = keccak256("RL10");

    /// @notice Role responsible for updating (applying) new core configuration if it was changed in the registry
    bytes32 internal constant CORE_CONFIGURATION_UPDATER_ROLE = keccak256("RL18");

    // ***** RESERVE *****

    /// @notice Role responsible for updating the reserve recipient's address of the profitable execution of derivatives positions
    bytes32 internal constant EXECUTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE = keccak256("RL2");

    /// @notice Role responsible for updating the reserve recipient's address of the redemption of market neutral positions
    bytes32 internal constant REDEMPTION_RESERVE_CLAIMER_ADDRESS_SETTER_ROLE = keccak256("RL3");

    /// @notice Role responsible for updating the fixed part (percentage) of the derivative author fees that goes to the protocol execution reserve
    bytes32 internal constant EXECUTION_RESERVE_PART_SETTER_ROLE = keccak256("RL4");

    /// @notice Role responsible for updating the maximum fee that a derivative author can set as a commission originated from the profitable execution of derivatives positions
    bytes32 internal constant DERIVATIVE_AUTHOR_EXECUTION_FEE_CAP_SETTER_ROLE = keccak256("RL8");

    /// @notice Role responsible for updating the fixed part (percentage) of the initial margin that will be deducted to the reserves during redemption of market neutral positions
    /// @notice Also sets fixed part (percentage) of this redemption reserves that goes to the protocol redemption reserve
    bytes32 internal constant REDEMPTION_RESERVE_PART_SETTER_ROLE = keccak256("RL9");

    // ***** EMERGENCY *****

    /// @notice Role responsible for globally pausing the protocol
    bytes32 internal constant GUARDIAN_ROLE = keccak256("RL6");

    /// @notice Role responsible for pausing Core.create
    bytes32 internal constant PARTIAL_CREATE_PAUSE_ROLE = keccak256("RL11");

    /// @notice Role responsible for pausing Core.mint
    bytes32 internal constant PARTIAL_MINT_PAUSE_ROLE = keccak256("RL12");

    /// @notice Role responsible for pausing Core.redeem
    bytes32 internal constant PARTIAL_REDEEM_PAUSE_ROLE = keccak256("RL13");

    /// @notice Role responsible for pausing Core.execute
    bytes32 internal constant PARTIAL_EXECUTE_PAUSE_ROLE = keccak256("RL14");

    /// @notice Role responsible for pausing Core.cancel
    bytes32 internal constant PARTIAL_CANCEL_PAUSE_ROLE = keccak256("RL15");

    /// @notice Role responsible for pausing Core.claimReserve
    bytes32 internal constant PARTIAL_CLAIM_RESERVE_PAUSE_ROLE = keccak256("RL16");

    /// @notice Role responsible for globally unpausing the protocol
    bytes32 internal constant PROTOCOL_UNPAUSER_ROLE = keccak256("RL17");
}

File 4 of 19 : LibCalculator.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

library LibCalculator {
    uint256 internal constant PERCENTAGE_BASE = 10000; // Represents 100%
    uint256 internal constant MAX_REDEMPTION_PART = 100; // Represents 1%

    function mulWithPrecisionFactor(uint256 _x, uint256 _y) internal pure returns (uint256) {
        return (_x * _y) / 1e18;
    }

    function modWithPrecisionFactor(uint256 _x) internal pure returns (uint256) {
        return _x % 1e18;
    }
}

File 5 of 19 : IOpiumProxyFactory.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;
import "../libs/LibDerivative.sol";

interface IOpiumProxyFactory {
    function getImplementationAddress() external view returns (address);

    function initialize(address _registry) external;

    function create(
        address _buyer,
        address _seller,
        uint256 _amount,
        bytes32 _derivativeHash,
        LibDerivative.Derivative calldata _derivative
    ) external;

    function mintPair(
        address _buyer,
        address _seller,
        address _longPositionAddress,
        address _shortPositionAddress,
        uint256 _amount
    ) external;

    function burn(
        address _positionOwner,
        address _positionAddress,
        uint256 _amount
    ) external;

    function burnPair(
        address _positionOwner,
        address _longPositionAddress,
        address _shortPositionAddress,
        uint256 _amount
    ) external;
}

File 6 of 19 : ISyntheticAggregator.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;
import "../libs/LibDerivative.sol";

interface ISyntheticAggregator {
    struct SyntheticCache {
        uint256 buyerMargin;
        uint256 sellerMargin;
        uint256 authorCommission;
        address authorAddress;
        bool init;
    }

    function initialize(address _registry) external;

    function getOrCacheSyntheticCache(bytes32 _derivativeHash, LibDerivative.Derivative calldata _derivative)
        external
        returns (SyntheticCache memory);

    function getOrCacheMargin(bytes32 _derivativeHash, LibDerivative.Derivative calldata _derivative)
        external
        returns (uint256 buyerMargin, uint256 sellerMargin);
}

File 7 of 19 : IOracleAggregator.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

interface IOracleAggregator {
    function __callback(uint256 timestamp, uint256 data) external;

    function getData(address oracleId, uint256 timestamp) external view returns (uint256 dataResult);

    function hasData(address oracleId, uint256 timestamp) external view returns (bool);
}

File 8 of 19 : ITokenSpender.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

interface ITokenSpender {
    function claimTokens(
        IERC20Upgradeable _token,
        address _from,
        address _to,
        uint256 _amount
    ) external;
}

File 9 of 19 : ICore.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

import "../core/registry/RegistryEntities.sol";
import "../libs/LibDerivative.sol";

interface ICore {
    function initialize(address _governor) external;

    function getProtocolParametersArgs() external view returns (RegistryEntities.ProtocolParametersArgs memory);

    function getProtocolAddresses() external view returns (RegistryEntities.ProtocolAddressesArgs memory);

    function getReservesVaultBalance(address _reseveRecipient, address _token) external view returns (uint256);

    function getDerivativePayouts(bytes32 _derivativeHash) external view returns (uint256[2] memory);

    function getP2pDerivativeVaultFunds(bytes32 _derivativeHash) external view returns (uint256);

    function isDerivativeCancelled(bytes32 _derivativeHash) external view returns (bool);

    function updateProtocolParametersArgs() external;

    function updateProtocolAddresses() external;

    function claimReserves(address _tokenAddress) external;

    function claimReserves(address _tokenAddress, uint256 _amount) external;

    function create(
        LibDerivative.Derivative calldata _derivative,
        uint256 _amount,
        address[2] calldata _positionsOwners
    ) external;

    function createAndMint(
        LibDerivative.Derivative calldata _derivative,
        uint256 _amount,
        address[2] calldata _positionsOwners,
        string calldata _derivativeAuthorCustomName
    ) external;

    function mint(
        uint256 _amount,
        address[2] calldata _positionsAddresses,
        address[2] calldata _positionsOwners
    ) external;

    function execute(address _positionAddress, uint256 _amount) external;

    function execute(
        address _positionOwner,
        address _positionAddress,
        uint256 _amount
    ) external;

    function execute(address[] calldata _positionsAddresses, uint256[] calldata _amounts) external;

    function execute(
        address _positionsOwner,
        address[] calldata _positionsAddresses,
        uint256[] calldata _amounts
    ) external;

    function redeem(address[2] calldata _positionsAddresses, uint256 _amount) external;

    function redeem(address[2][] calldata _positionsAddresses, uint256[] calldata _amounts) external;

    function cancel(address _positionAddress, uint256 _amount) external;

    function cancel(address[] calldata _positionsAddresses, uint256[] calldata _amounts) external;
}

File 10 of 19 : IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControlUpgradeable {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

File 12 of 19 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 13 of 19 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
    function __ERC165_init() internal onlyInitializing {
        __ERC165_init_unchained();
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165Upgradeable).interfaceId;
    }
    uint256[50] private __gap;
}

File 14 of 19 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 15 of 19 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 16 of 19 : IERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165Upgradeable {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 17 of 19 : LibDerivative.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

/// @title Opium.Lib.LibDerivative contract should be inherited by contracts that use Derivative structure and calculate derivativeHash
library LibDerivative {
    enum PositionType {
        SHORT,
        LONG
    }

    // Opium derivative structure (ticker) definition
    struct Derivative {
        // Margin parameter for syntheticId
        uint256 margin;
        // Maturity of derivative
        uint256 endTime;
        // Additional parameters for syntheticId
        uint256[] params;
        // oracleId of derivative
        address oracleId;
        // Margin token address of derivative
        address token;
        // syntheticId of derivative
        address syntheticId;
    }

    /// @notice Calculates hash of provided Derivative
    /// @param _derivative Derivative Instance of derivative to hash
    /// @return derivativeHash bytes32 Derivative hash
    function getDerivativeHash(Derivative memory _derivative) internal pure returns (bytes32 derivativeHash) {
        derivativeHash = keccak256(
            abi.encodePacked(
                _derivative.margin,
                _derivative.endTime,
                _derivative.params,
                _derivative.oracleId,
                _derivative.token,
                _derivative.syntheticId
            )
        );
    }
}

File 18 of 19 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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);
}

File 19 of 19 : RegistryEntities.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

library RegistryEntities {
    struct ProtocolParametersArgs {
        // Period of time after which ticker could be canceled if no data was provided to the `oracleId`
        uint32 noDataCancellationPeriod;
        // Max fee that derivative author can set
        // it works as an upper bound for when the derivative authors set their synthetic's fee
        uint32 derivativeAuthorExecutionFeeCap;
        // Fixed part (percentage) that the derivative author receives for each redemption of market neutral positions
        // It is not set by the derivative authors themselves
        uint32 derivativeAuthorRedemptionReservePart;
        // Represents which part of derivative author reserves originated from derivative executions go to the protocol reserves
        uint32 protocolExecutionReservePart;
        // Represents which part of derivative author reserves originated from redemption of market neutral positions go to the protocol reserves
        uint32 protocolRedemptionReservePart;
        /// Initially uninitialized variables to allow some flexibility in case of future changes and upgradeability
        uint32 __gapOne;
        uint32 __gapTwo;
        uint32 __gapThree;
    }

    struct ProtocolAddressesArgs {
        // Address of Opium.Core contract
        address core;
        // Address of Opium.OpiumProxyFactory contract
        address opiumProxyFactory;
        // Address of Opium.OracleAggregator contract
        address oracleAggregator;
        // Address of Opium.SyntheticAggregator contract
        address syntheticAggregator;
        // Address of Opium.TokenSpender contract
        address tokenSpender;
        // Address of the recipient of execution protocol reserves
        address protocolExecutionReserveClaimer;
        // Address of the recipient of redemption protocol reserves
        address protocolRedemptionReserveClaimer;
        /// Initially uninitialized variables to allow some flexibility in case of future changes and upgradeability
        uint32 __gapOne;
        uint32 __gapTwo;
    }

    struct ProtocolPausabilityArgs {
        // if true, all the protocol's entry-points are paused
        bool protocolGlobal;
        // if true, no new positions can be created
        bool protocolPositionCreation;
        // if true, no new positions can be minted
        bool protocolPositionMinting;
        // if true, no new positions can be redeemed
        bool protocolPositionRedemption;
        // if true, no new positions can be executed
        bool protocolPositionExecution;
        // if true, no new positions can be cancelled
        bool protocolPositionCancellation;
        // if true, no reserves can be claimed
        bool protocolReserveClaim;
        /// Initially uninitialized variables to allow some flexibility in case of future changes and upgradeability
        bool __gapOne;
        bool __gapTwo;
        bool __gapThree;
        bool __gapFour;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"uint32","name":"_derivativeAuthorExecutionFeeCap","type":"uint32"}],"name":"LogDerivativeAuthorExecutionFeeCapChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"uint32","name":"_derivativeAuthorRedemptionReservePart","type":"uint32"}],"name":"LogDerivativeAuthorRedemptionReservePartChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"uint256","name":"_noDataCancellationPeriod","type":"uint256"}],"name":"LogNoDataCancellationPeriodChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"address","name":"_protocolExecutionReserveClaimer","type":"address"}],"name":"LogProtocolExecutionReserveClaimerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"uint32","name":"_protocolExecutionReservePart","type":"uint32"}],"name":"LogProtocolExecutionReservePartChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"bool","name":"_state","type":"bool"},{"indexed":true,"internalType":"bytes32","name":"_role","type":"bytes32"}],"name":"LogProtocolPausableStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"address","name":"_protocolRedemptionReserveClaimer","type":"address"}],"name":"LogProtocolRedemptionReserveClaimerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"uint32","name":"_protocolRedemptionReservePart","type":"uint32"}],"name":"LogProtocolRedemptionReservePartChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"address","name":"_whitelisted","type":"address"}],"name":"LogWhitelistAccountAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_setter","type":"address"},{"indexed":true,"internalType":"address","name":"_unlisted","type":"address"}],"name":"LogWhitelistAccountRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelisted","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCore","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolAddresses","outputs":[{"components":[{"internalType":"address","name":"core","type":"address"},{"internalType":"address","name":"opiumProxyFactory","type":"address"},{"internalType":"address","name":"oracleAggregator","type":"address"},{"internalType":"address","name":"syntheticAggregator","type":"address"},{"internalType":"address","name":"tokenSpender","type":"address"},{"internalType":"address","name":"protocolExecutionReserveClaimer","type":"address"},{"internalType":"address","name":"protocolRedemptionReserveClaimer","type":"address"},{"internalType":"uint32","name":"__gapOne","type":"uint32"},{"internalType":"uint32","name":"__gapTwo","type":"uint32"}],"internalType":"struct RegistryEntities.ProtocolAddressesArgs","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProtocolParameters","outputs":[{"components":[{"internalType":"uint32","name":"noDataCancellationPeriod","type":"uint32"},{"internalType":"uint32","name":"derivativeAuthorExecutionFeeCap","type":"uint32"},{"internalType":"uint32","name":"derivativeAuthorRedemptionReservePart","type":"uint32"},{"internalType":"uint32","name":"protocolExecutionReservePart","type":"uint32"},{"internalType":"uint32","name":"protocolRedemptionReservePart","type":"uint32"},{"internalType":"uint32","name":"__gapOne","type":"uint32"},{"internalType":"uint32","name":"__gapTwo","type":"uint32"},{"internalType":"uint32","name":"__gapThree","type":"uint32"}],"internalType":"struct RegistryEntities.ProtocolParametersArgs","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_governor","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isCoreConfigurationUpdater","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isCoreSpenderWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPositionCancellationPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPositionCreationPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPositionExecutionPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPositionMintingPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolPositionRedemptionPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isProtocolReserveClaimPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"isRegistryManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolPositionCancellation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolPositionCreation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolPositionExecution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolPositionMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolPositionRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pauseProtocolReserveClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelisted","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_derivativeAuthorExecutionFeeCap","type":"uint32"}],"name":"setDerivativeAuthorExecutionFeeCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_derivativeAuthorRedemptionReservePart","type":"uint32"}],"name":"setDerivativeAuthorRedemptionReservePart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_noDataCancellationPeriod","type":"uint32"}],"name":"setNoDataCancellationPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_opiumProxyFactory","type":"address"},{"internalType":"address","name":"_core","type":"address"},{"internalType":"address","name":"_oracleAggregator","type":"address"},{"internalType":"address","name":"_syntheticAggregator","type":"address"},{"internalType":"address","name":"_tokenSpender","type":"address"}],"name":"setProtocolAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolExecutionReserveClaimer","type":"address"}],"name":"setProtocolExecutionReserveClaimer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_protocolExecutionReservePart","type":"uint32"}],"name":"setProtocolExecutionReservePart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_protocolRedemptionReserveClaimer","type":"address"}],"name":"setProtocolRedemptionReserveClaimer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_protocolRedemptionReservePart","type":"uint32"}],"name":"setProtocolRedemptionReservePart","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506126b7806100206000396000f3fe608060405234801561001057600080fd5b50600436106102ac5760003560e01c8063a31923951161017b578063dac88561116100d8578063f10827e01161008c578063f6c228a811610071578063f6c228a8146106e3578063fbb5cfec146106eb578063fbc422f6146106f357600080fd5b8063f10827e0146106d3578063f5e0f847146106db57600080fd5b8063e26c6b7d116100bd578063e26c6b7d146106a5578063e43252d7146106b8578063e455d587146106cb57600080fd5b8063dac8856114610692578063dd1eb52c1461069d57600080fd5b8063c58aad871161012f578063cc0549e311610114578063cc0549e31461065c578063d547741f14610664578063da4fbe521461067757600080fd5b8063c58aad8714610573578063c823b5db1461065457600080fd5b8063b990690711610160578063b990690714610521578063bd6962d114610534578063c4d66de81461056057600080fd5b8063a319239514610506578063b2037c551461051957600080fd5b8063488f1cbe1161022957806391d14854116101dd5780639e30941b116101c25780639e30941b14610410578063a1774da014610423578063a217fddf146104fe57600080fd5b806391d14854146103cf5780639baacb871461040857600080fd5b8063698ef9931161020e578063698ef993146103a15780638456cb59146103b45780638ab1d681146103bc57600080fd5b8063488f1cbe146103865780634e562cbb1461039957600080fd5b80632f2ff15d1161028057806336568abe1161026557806336568abe146103585780633f4ba83a1461036b5780634048d9091461037357600080fd5b80632f2ff15d14610332578063315d0db41461034557600080fd5b8062c92e42146102b157806301ffc9a7146102c657806307d7ecb6146102ee578063248a9ca314610301575b600080fd5b6102c46102bf3660046123d4565b6106fb565b005b6102d96102d43660046123aa565b61080a565b60405190151581526020015b60405180910390f35b6102c46102fc366004612300565b610841565b61032461030f366004612365565b60009081526065602052604090206001015490565b6040519081526020016102e5565b6102c461034036600461237e565b610991565b6102c46103533660046122e5565b6109bc565b6102c461036636600461237e565b610aa7565b6102c4610b33565b6102d96103813660046122e5565b610bfc565b6102c46103943660046123d4565b610c3c565b6102d9610d38565b6102d96103af3660046122e5565b610d5c565b6102c4610d9c565b6102c46103ca3660046122e5565b610e98565b6102d96103dd36600461237e565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6102c4610f45565b6102c461041e3660046122e5565b611048565b6104f16040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526098546001600160a01b03908116825260995481166020830152609a54811692820192909252609b5482166060820152609c5482166080820152609d54821660a0820152609e5491821660c082015263ffffffff600160a01b8304811660e0830152600160c01b90920490911661010082015290565b6040516102e591906124ae565b610324600081565b6102c46105143660046123d4565b611133565b6102c46111dc565b6102c461052f3660046123d4565b6112e5565b6102d96105423660046122e5565b6001600160a01b0316600090815260a0602052604090205460ff1690565b6102c461056e3660046122e5565b6113e9565b6106476040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915250604080516101008101825260975463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c01000000000000000000000000810483166060830152600160801b810483166080830152600160a01b8104831660a0830152600160c01b8104831660c0830152600160e01b900490911660e082015290565b6040516102e5919061253a565b6102d96117dc565b6102c46117fd565b6102c461067236600461237e565b61190f565b6098546040516001600160a01b0390911681526020016102e5565b609f5460ff166102d9565b6102d9611935565b6102c46106b33660046123d4565b611954565b6102c46106c63660046122e5565b611a48565b6102c4611af8565b6102d9611c04565b6102d9611c24565b6102c4611c47565b6102c4611d4d565b6102d9611e5c565b3360009081527f0faad572c43c9761ed61f423d6d106c39e1b0065a51556d39d05bcdec380d7f3602052604090205460ff166107635760405162461bcd60e51b8152602060048201526002602482015261523960f01b60448201526064015b60405180910390fd5b6127108163ffffffff16106107a05760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff16600160801b63ffffffff84169081029190911790915560405133907f1a1468e93fd8855e6609e537f786724a4321061b8b716e3f37393c53f721a2a390600090a350565b60006001600160e01b03198216637965db0b60e01b148061083b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b3360009081527ff860dc4d49b58b15761fa013a40ed9a8e5c703456c7681d309655e2140ffc53a602052604090205460ff166108a45760405162461bcd60e51b8152602060048201526002602482015261523160f01b604482015260640161075a565b6001600160a01b038516158015906108c457506001600160a01b03841615155b80156108d857506001600160a01b03831615155b80156108ec57506001600160a01b03821615155b801561090057506001600160a01b03811615155b6109325760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609980546001600160a01b03199081166001600160a01b039788161790915560988054821695871695909517909455609a8054851693861693909317909255609b80548416918516919091179055609c80549092169216919091179055565b6000828152606560205260409020600101546109ad8133611e7a565b6109b78383611efa565b505050565b3360009081527f0a7485b578decb844695fec73e47de9e3a0a0f61ade08dc3183b30f6ddac5f03602052604090205460ff16610a1f5760405162461bcd60e51b8152602060048201526002602482015261523360f01b604482015260640161075a565b6001600160a01b038116610a5b5760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609e80546001600160a01b0319166001600160a01b03831690811790915560405133907fe1b970507d04d56360abbd36d859d78cd6e65104574141796e49aa6c72da517190600090a350565b6001600160a01b0381163314610b255760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161075a565b610b2f8282611f9c565b5050565b3360009081527f2d416a7e271f66853844bd9dc5cd274140b3d4ed65d3f4afcf1cfebd790dacaa602052604090205460ff16610b975760405162461bcd60e51b815260206004820152600360248201526252313960e81b604482015260640161075a565b609f80546affffffffffffffffffffff191690556040517f75d435b8ed45738e662759d0e2a87a699b5c6e9cdd9593f483f195bfc764e6909060009033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a62908390a4565b6001600160a01b03811660009081527f575d0b624afc72dea7d42668674270c86384c6196dd270cbc4fc1b5ed5cdbcff602052604081205460ff1661083b565b3360009081527f0faad572c43c9761ed61f423d6d106c39e1b0065a51556d39d05bcdec380d7f3602052604090205460ff16610c9f5760405162461bcd60e51b8152602060048201526002602482015261523960f01b604482015260640161075a565b60648163ffffffff161115610cdc5760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780546bffffffff000000000000000019166801000000000000000063ffffffff84169081029190911790915560405133907fd8cef7e691d07b1709503d29fa0717df64a78dbc8d86de1efabb15cf614b1ccd90600090a350565b609f5460009060ff1680610d575750609f5465010000000000900460ff165b905090565b6001600160a01b03811660009081527faaf2a71ee48636e8ae3a1955ae821e40d2cf5ab657d8933f1c1465e2a5bc4464602052604081205460ff1661083b565b3360009081527f1ce91ab5e0e81f316105d9217fc91329058104a15dc4476cf1844d77125686a5602052604090205460ff16610dff5760405162461bcd60e51b8152602060048201526002602482015261291b60f11b604482015260640161075a565b609f5460ff1615610e385760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805460ff191660019081179091556040517f2ca8e8dfde9481c8a047cde1353357bf2e606d7d1eca452231d961937a4c5aca919033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527f7a8dde43a7bc7e69e79f4e84c777c056b60ffe4a66e8627aaef837e50f847a24602052604090205460ff16610efb5760405162461bcd60e51b8152602060048201526002602482015261523760f01b604482015260640161075a565b6001600160a01b038116600081815260a06020526040808220805460ff191690555133917fd358711b94a3144deea84d17279846b11eac142209e2dbd93bc9eb9fb604db4c91a350565b3360009081527fb6b9868e4af9bfd0fc3575c1c867f9d0e77d5ed2905add1f763bcb8431db891e602052604090205460ff16610fa95760405162461bcd60e51b815260206004820152600360248201526252313360e81b604482015260640161075a565b609f54610100900460ff1615610fe75760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805461ff0019166101001790556040517ff3de4533ff00ef299a11d619e1a5d244e6ff5fa1f474c653ed54cbb6ef9394369060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527fa32a36b5c1804037ae493fce4127c36b5d0307d0508b7072f2ef402ea4851120602052604090205460ff166110ab5760405162461bcd60e51b8152602060048201526002602482015261291960f11b604482015260640161075a565b6001600160a01b0381166110e75760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609d80546001600160a01b0319166001600160a01b03831690811790915560405133907fd5c726c653300378b00ef01ee104e9b96adc0bc2442f71d420cd3a3d4bec188790600090a350565b3360009081527f84865fc2265c4ba049bd22aa05d3408f1b8cdf3f3e74978e5465ec4aa715cde8602052604090205460ff166111965760405162461bcd60e51b8152602060048201526002602482015261523560f01b604482015260640161075a565b6097805463ffffffff191663ffffffff831690811790915560405133907fec3d573c5a02aa38f73469c1fc6a491757b0a37dd6d2203b225fabedf2faaf3490600090a350565b3360009081527fd3425a59594079ca15994324f0b074f0d18f9670d322b79481b9220713780f70602052604090205460ff166112405760405162461bcd60e51b815260206004820152600360248201526252313560e81b604482015260640161075a565b609f546301000000900460ff16156112805760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805463ff000000191663010000001790556040517f1492d97ab6e4d8c7ca956834bc38263ad70284a7fdf818879444c466f060a8739060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527f3b51f19727f995496c81c5d4aad41d5c583bbd77a06ae445f5fb07d146f44861602052604090205460ff166113485760405162461bcd60e51b8152602060048201526002602482015261148d60f21b604482015260640161075a565b6127108163ffffffff16106113855760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780546fffffffff00000000000000000000000019166c0100000000000000000000000063ffffffff84169081029190911790915560405133907f26dfdabb870fe87855acdd50ba095834d3b321959344d33c4e4d1ced661dc02390600090a350565b600054610100900460ff166114045760005460ff1615611408565b303b155b61147a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161075a565b600054610100900460ff1615801561149c576000805461ffff19166101011790555b6114a461201f565b6114af6000836120a4565b6114d97f8bed349beb182b4c10ffa09b24228eeab3af7dfd7ed1f15102a7dbe7a6f5d813836120a4565b6115037fea6cbf7d4e5f24055ba3677c8ea492419947fab4a7deeed8f4803fe415aad050836120a4565b61152d7f88cc9cd9c54f9fbc935dfdf1daaa59ded01685c6fc56d4cb843e720a8d1c183d836120a4565b6115577f0f4989a44d2d609558af77c6ff340e14d02f94ee75ea4ad3948292d33e8ed7b1836120a4565b6115817f390296b51502c03a83e20c8a2c4c75d5f9a6a9b012895550215a37783529363a836120a4565b6115ab7f6b7485dc29163dc8d5a5ba04f2e13702d6d8acaacfe7f15bfc9daeb62e0c1db6836120a4565b6115d57f1632efe3ce40cb1d1888fdab2f730ce74336e4153192c4fae3aa5d9fd8edcd03836120a4565b6115ff7fab2c7b53772c7d4909be14bd92182b417e0e3ccbc293e79bb476c884c5b9eacb836120a4565b6116297f70c561384e26c2d11e737b3121a1bf9f8952b626d42bcd32efa0c805e750f844836120a4565b6116537fce5263906f3edf48ea37bf5a7fd9e307ecfb9a93febf8fbbd02951271e2a5935836120a4565b61167d7f2ca8e8dfde9481c8a047cde1353357bf2e606d7d1eca452231d961937a4c5aca836120a4565b6116a77ff3de4533ff00ef299a11d619e1a5d244e6ff5fa1f474c653ed54cbb6ef939436836120a4565b6116d17f2455f7a8bbdd0bb4e98fefba1846d37b1c2aaefb411547a266276157e5c75d2d836120a4565b6116fb7f1492d97ab6e4d8c7ca956834bc38263ad70284a7fdf818879444c466f060a873836120a4565b6117257f60a9770968af425ab1edbca869fda04c84d1c0fd21db260dfc186a3ef3e3e14f836120a4565b61174f7ff29bdb744edfeb41e2161a3a29b928fe654603a4e2b5577a7855149e9916a64b836120a4565b6117797f50a9ed8fc1c890456f829cbba972ff82bb1658c43895e7bee5d1fec9871e9b39836120a4565b6117a37f75d435b8ed45738e662759d0e2a87a699b5c6e9cdd9593f483f195bfc764e690836120a4565b609780546001600160a01b0319167103e8000003e80000000a000003e8001275001790558015610b2f576000805461ff00191690555050565b609f5460009060ff1680610d57575050609f54640100000000900460ff1690565b3360009081527f3da570987684dbd89cdc86e6f721d2e0b7865d41bbb84be8fd033708221cb9b6602052604090205460ff166118615760405162461bcd60e51b81526020600482015260036024820152620a462760eb1b604482015260640161075a565b609f546601000000000000900460ff16156118a45760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805466ff000000000000191666010000000000001790556040517f50a9ed8fc1c890456f829cbba972ff82bb1658c43895e7bee5d1fec9871e9b399060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b60008281526065602052604090206001015461192b8133611e7a565b6109b78383611f9c565b609f5460009060ff1680610d57575050609f5462010000900460ff1690565b3360009081527fdac563a5eca333c5ee2ee69b76f4796bd8890408c930745ef9b47200c0b4a121602052604090205460ff166119b75760405162461bcd60e51b81526020600482015260026024820152610a4760f31b604482015260640161075a565b6127108163ffffffff16106119f45760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b6097805467ffffffff00000000191664010000000063ffffffff84169081029190911790915560405133907f456798d7429d6deef71c19b900fa05ce0bc150d970f312fac0396efe0ed89e2f90600090a350565b3360009081527f7a8dde43a7bc7e69e79f4e84c777c056b60ffe4a66e8627aaef837e50f847a24602052604090205460ff16611aab5760405162461bcd60e51b8152602060048201526002602482015261523760f01b604482015260640161075a565b6001600160a01b038116600081815260a06020526040808220805460ff191660011790555133917f0beb05eda27aaa12c3879f90bf15e464bae38f391a8e75a12dc287ac2fdc29b591a350565b3360009081527f77f13b16c87b7f2f2e4e7e8fee3e2c404557d2df5b89ffd3e0e81d5b6a75af32602052604090205460ff16611b5c5760405162461bcd60e51b815260206004820152600360248201526229189b60e91b604482015260640161075a565b609f54640100000000900460ff1615611b9d5760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805464ff0000000019166401000000001790556040517f60a9770968af425ab1edbca869fda04c84d1c0fd21db260dfc186a3ef3e3e14f9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b609f5460009060ff1680610d57575050609f546301000000900460ff1690565b609f5460009060ff1680610d57575050609f546601000000000000900460ff1690565b3360009081527f53ebb4d5020e385d4b47c75dab8fa68f4e9953c2ea2a824d50ad61d7fbe1e85e602052604090205460ff16611cab5760405162461bcd60e51b8152602060048201526003602482015262148c4d60ea1b604482015260640161075a565b609f5462010000900460ff1615611cea5760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805462ff00001916620100001790556040517f2455f7a8bbdd0bb4e98fefba1846d37b1c2aaefb411547a266276157e5c75d2d9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527fff6cba3daff300f2d51631d1bfa726734b8a02fb6bf1bfe8fabaa748202a8518602052604090205460ff16611db15760405162461bcd60e51b815260206004820152600360248201526252313760e81b604482015260640161075a565b609f5465010000000000900460ff1615611df35760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805465ff00000000001916650100000000001790556040517ff29bdb744edfeb41e2161a3a29b928fe654603a4e2b5577a7855149e9916a64b9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b609f5460009060ff1680610d57575050609f54610100900460ff1690565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b2f57611eb8816001600160a01b031660146120ae565b611ec38360206120ae565b604051602001611ed49291906123fa565b60408051601f198184030181529082905262461bcd60e51b825261075a9160040161247b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b2f5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611f583390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610b2f5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff1661208a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161075a565b61209261225e565b61209a61225e565b6120a261225e565b565b610b2f8282611efa565b606060006120bd8360026125d9565b6120c89060026125c1565b67ffffffffffffffff8111156120e0576120e061266b565b6040519080825280601f01601f19166020018201604052801561210a576020820181803683370190505b509050600360fc1b8160008151811061212557612125612655565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061215457612154612655565b60200101906001600160f81b031916908160001a90535060006121788460026125d9565b6121839060016125c1565b90505b6001811115612208577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121c4576121c4612655565b1a60f81b8282815181106121da576121da612655565b60200101906001600160f81b031916908160001a90535060049490941c9361220181612628565b9050612186565b5083156122575760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161075a565b9392505050565b600054610100900460ff166120a25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161075a565b80356001600160a01b03811681146122e057600080fd5b919050565b6000602082840312156122f757600080fd5b612257826122c9565b600080600080600060a0868803121561231857600080fd5b612321866122c9565b945061232f602087016122c9565b935061233d604087016122c9565b925061234b606087016122c9565b9150612359608087016122c9565b90509295509295909350565b60006020828403121561237757600080fd5b5035919050565b6000806040838503121561239157600080fd5b823591506123a1602084016122c9565b90509250929050565b6000602082840312156123bc57600080fd5b81356001600160e01b03198116811461225757600080fd5b6000602082840312156123e657600080fd5b813563ffffffff8116811461225757600080fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124328160178501602088016125f8565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161246f8160288401602088016125f8565b01602801949350505050565b602081526000825180602084015261249a8160408501602087016125f8565b601f01601f19169190910160400192915050565b81516001600160a01b03908116825260208084015182169083015260408084015182169083015260608084015182169083015260808084015182169083015260a08084015182169083015260c080840151918216908301526101208201905060e083015161252460e084018263ffffffff169052565b506101009283015163ffffffff16919092015290565b60006101008201905063ffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525060c08301516125a260c084018263ffffffff169052565b5060e08301516125ba60e084018263ffffffff169052565b5092915050565b600082198211156125d4576125d461263f565b500190565b60008160001904831182151516156125f3576125f361263f565b500290565b60005b838110156126135781810151838201526020016125fb565b83811115612622576000848401525b50505050565b6000816126375761263761263f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212203480ae9c0018a635f2d62eb41a6ba115e842beb89a6ea70a64c888e8a24c230864736f6c63430008050033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102ac5760003560e01c8063a31923951161017b578063dac88561116100d8578063f10827e01161008c578063f6c228a811610071578063f6c228a8146106e3578063fbb5cfec146106eb578063fbc422f6146106f357600080fd5b8063f10827e0146106d3578063f5e0f847146106db57600080fd5b8063e26c6b7d116100bd578063e26c6b7d146106a5578063e43252d7146106b8578063e455d587146106cb57600080fd5b8063dac8856114610692578063dd1eb52c1461069d57600080fd5b8063c58aad871161012f578063cc0549e311610114578063cc0549e31461065c578063d547741f14610664578063da4fbe521461067757600080fd5b8063c58aad8714610573578063c823b5db1461065457600080fd5b8063b990690711610160578063b990690714610521578063bd6962d114610534578063c4d66de81461056057600080fd5b8063a319239514610506578063b2037c551461051957600080fd5b8063488f1cbe1161022957806391d14854116101dd5780639e30941b116101c25780639e30941b14610410578063a1774da014610423578063a217fddf146104fe57600080fd5b806391d14854146103cf5780639baacb871461040857600080fd5b8063698ef9931161020e578063698ef993146103a15780638456cb59146103b45780638ab1d681146103bc57600080fd5b8063488f1cbe146103865780634e562cbb1461039957600080fd5b80632f2ff15d1161028057806336568abe1161026557806336568abe146103585780633f4ba83a1461036b5780634048d9091461037357600080fd5b80632f2ff15d14610332578063315d0db41461034557600080fd5b8062c92e42146102b157806301ffc9a7146102c657806307d7ecb6146102ee578063248a9ca314610301575b600080fd5b6102c46102bf3660046123d4565b6106fb565b005b6102d96102d43660046123aa565b61080a565b60405190151581526020015b60405180910390f35b6102c46102fc366004612300565b610841565b61032461030f366004612365565b60009081526065602052604090206001015490565b6040519081526020016102e5565b6102c461034036600461237e565b610991565b6102c46103533660046122e5565b6109bc565b6102c461036636600461237e565b610aa7565b6102c4610b33565b6102d96103813660046122e5565b610bfc565b6102c46103943660046123d4565b610c3c565b6102d9610d38565b6102d96103af3660046122e5565b610d5c565b6102c4610d9c565b6102c46103ca3660046122e5565b610e98565b6102d96103dd36600461237e565b60009182526065602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6102c4610f45565b6102c461041e3660046122e5565b611048565b6104f16040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091525060408051610120810182526098546001600160a01b03908116825260995481166020830152609a54811692820192909252609b5482166060820152609c5482166080820152609d54821660a0820152609e5491821660c082015263ffffffff600160a01b8304811660e0830152600160c01b90920490911661010082015290565b6040516102e591906124ae565b610324600081565b6102c46105143660046123d4565b611133565b6102c46111dc565b6102c461052f3660046123d4565b6112e5565b6102d96105423660046122e5565b6001600160a01b0316600090815260a0602052604090205460ff1690565b6102c461056e3660046122e5565b6113e9565b6106476040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915250604080516101008101825260975463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c01000000000000000000000000810483166060830152600160801b810483166080830152600160a01b8104831660a0830152600160c01b8104831660c0830152600160e01b900490911660e082015290565b6040516102e5919061253a565b6102d96117dc565b6102c46117fd565b6102c461067236600461237e565b61190f565b6098546040516001600160a01b0390911681526020016102e5565b609f5460ff166102d9565b6102d9611935565b6102c46106b33660046123d4565b611954565b6102c46106c63660046122e5565b611a48565b6102c4611af8565b6102d9611c04565b6102d9611c24565b6102c4611c47565b6102c4611d4d565b6102d9611e5c565b3360009081527f0faad572c43c9761ed61f423d6d106c39e1b0065a51556d39d05bcdec380d7f3602052604090205460ff166107635760405162461bcd60e51b8152602060048201526002602482015261523960f01b60448201526064015b60405180910390fd5b6127108163ffffffff16106107a05760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff16600160801b63ffffffff84169081029190911790915560405133907f1a1468e93fd8855e6609e537f786724a4321061b8b716e3f37393c53f721a2a390600090a350565b60006001600160e01b03198216637965db0b60e01b148061083b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b3360009081527ff860dc4d49b58b15761fa013a40ed9a8e5c703456c7681d309655e2140ffc53a602052604090205460ff166108a45760405162461bcd60e51b8152602060048201526002602482015261523160f01b604482015260640161075a565b6001600160a01b038516158015906108c457506001600160a01b03841615155b80156108d857506001600160a01b03831615155b80156108ec57506001600160a01b03821615155b801561090057506001600160a01b03811615155b6109325760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609980546001600160a01b03199081166001600160a01b039788161790915560988054821695871695909517909455609a8054851693861693909317909255609b80548416918516919091179055609c80549092169216919091179055565b6000828152606560205260409020600101546109ad8133611e7a565b6109b78383611efa565b505050565b3360009081527f0a7485b578decb844695fec73e47de9e3a0a0f61ade08dc3183b30f6ddac5f03602052604090205460ff16610a1f5760405162461bcd60e51b8152602060048201526002602482015261523360f01b604482015260640161075a565b6001600160a01b038116610a5b5760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609e80546001600160a01b0319166001600160a01b03831690811790915560405133907fe1b970507d04d56360abbd36d859d78cd6e65104574141796e49aa6c72da517190600090a350565b6001600160a01b0381163314610b255760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161075a565b610b2f8282611f9c565b5050565b3360009081527f2d416a7e271f66853844bd9dc5cd274140b3d4ed65d3f4afcf1cfebd790dacaa602052604090205460ff16610b975760405162461bcd60e51b815260206004820152600360248201526252313960e81b604482015260640161075a565b609f80546affffffffffffffffffffff191690556040517f75d435b8ed45738e662759d0e2a87a699b5c6e9cdd9593f483f195bfc764e6909060009033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a62908390a4565b6001600160a01b03811660009081527f575d0b624afc72dea7d42668674270c86384c6196dd270cbc4fc1b5ed5cdbcff602052604081205460ff1661083b565b3360009081527f0faad572c43c9761ed61f423d6d106c39e1b0065a51556d39d05bcdec380d7f3602052604090205460ff16610c9f5760405162461bcd60e51b8152602060048201526002602482015261523960f01b604482015260640161075a565b60648163ffffffff161115610cdc5760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780546bffffffff000000000000000019166801000000000000000063ffffffff84169081029190911790915560405133907fd8cef7e691d07b1709503d29fa0717df64a78dbc8d86de1efabb15cf614b1ccd90600090a350565b609f5460009060ff1680610d575750609f5465010000000000900460ff165b905090565b6001600160a01b03811660009081527faaf2a71ee48636e8ae3a1955ae821e40d2cf5ab657d8933f1c1465e2a5bc4464602052604081205460ff1661083b565b3360009081527f1ce91ab5e0e81f316105d9217fc91329058104a15dc4476cf1844d77125686a5602052604090205460ff16610dff5760405162461bcd60e51b8152602060048201526002602482015261291b60f11b604482015260640161075a565b609f5460ff1615610e385760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805460ff191660019081179091556040517f2ca8e8dfde9481c8a047cde1353357bf2e606d7d1eca452231d961937a4c5aca919033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527f7a8dde43a7bc7e69e79f4e84c777c056b60ffe4a66e8627aaef837e50f847a24602052604090205460ff16610efb5760405162461bcd60e51b8152602060048201526002602482015261523760f01b604482015260640161075a565b6001600160a01b038116600081815260a06020526040808220805460ff191690555133917fd358711b94a3144deea84d17279846b11eac142209e2dbd93bc9eb9fb604db4c91a350565b3360009081527fb6b9868e4af9bfd0fc3575c1c867f9d0e77d5ed2905add1f763bcb8431db891e602052604090205460ff16610fa95760405162461bcd60e51b815260206004820152600360248201526252313360e81b604482015260640161075a565b609f54610100900460ff1615610fe75760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805461ff0019166101001790556040517ff3de4533ff00ef299a11d619e1a5d244e6ff5fa1f474c653ed54cbb6ef9394369060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527fa32a36b5c1804037ae493fce4127c36b5d0307d0508b7072f2ef402ea4851120602052604090205460ff166110ab5760405162461bcd60e51b8152602060048201526002602482015261291960f11b604482015260640161075a565b6001600160a01b0381166110e75760405162461bcd60e51b815260206004820152600360248201526229189960e91b604482015260640161075a565b609d80546001600160a01b0319166001600160a01b03831690811790915560405133907fd5c726c653300378b00ef01ee104e9b96adc0bc2442f71d420cd3a3d4bec188790600090a350565b3360009081527f84865fc2265c4ba049bd22aa05d3408f1b8cdf3f3e74978e5465ec4aa715cde8602052604090205460ff166111965760405162461bcd60e51b8152602060048201526002602482015261523560f01b604482015260640161075a565b6097805463ffffffff191663ffffffff831690811790915560405133907fec3d573c5a02aa38f73469c1fc6a491757b0a37dd6d2203b225fabedf2faaf3490600090a350565b3360009081527fd3425a59594079ca15994324f0b074f0d18f9670d322b79481b9220713780f70602052604090205460ff166112405760405162461bcd60e51b815260206004820152600360248201526252313560e81b604482015260640161075a565b609f546301000000900460ff16156112805760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805463ff000000191663010000001790556040517f1492d97ab6e4d8c7ca956834bc38263ad70284a7fdf818879444c466f060a8739060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527f3b51f19727f995496c81c5d4aad41d5c583bbd77a06ae445f5fb07d146f44861602052604090205460ff166113485760405162461bcd60e51b8152602060048201526002602482015261148d60f21b604482015260640161075a565b6127108163ffffffff16106113855760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b609780546fffffffff00000000000000000000000019166c0100000000000000000000000063ffffffff84169081029190911790915560405133907f26dfdabb870fe87855acdd50ba095834d3b321959344d33c4e4d1ced661dc02390600090a350565b600054610100900460ff166114045760005460ff1615611408565b303b155b61147a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161075a565b600054610100900460ff1615801561149c576000805461ffff19166101011790555b6114a461201f565b6114af6000836120a4565b6114d97f8bed349beb182b4c10ffa09b24228eeab3af7dfd7ed1f15102a7dbe7a6f5d813836120a4565b6115037fea6cbf7d4e5f24055ba3677c8ea492419947fab4a7deeed8f4803fe415aad050836120a4565b61152d7f88cc9cd9c54f9fbc935dfdf1daaa59ded01685c6fc56d4cb843e720a8d1c183d836120a4565b6115577f0f4989a44d2d609558af77c6ff340e14d02f94ee75ea4ad3948292d33e8ed7b1836120a4565b6115817f390296b51502c03a83e20c8a2c4c75d5f9a6a9b012895550215a37783529363a836120a4565b6115ab7f6b7485dc29163dc8d5a5ba04f2e13702d6d8acaacfe7f15bfc9daeb62e0c1db6836120a4565b6115d57f1632efe3ce40cb1d1888fdab2f730ce74336e4153192c4fae3aa5d9fd8edcd03836120a4565b6115ff7fab2c7b53772c7d4909be14bd92182b417e0e3ccbc293e79bb476c884c5b9eacb836120a4565b6116297f70c561384e26c2d11e737b3121a1bf9f8952b626d42bcd32efa0c805e750f844836120a4565b6116537fce5263906f3edf48ea37bf5a7fd9e307ecfb9a93febf8fbbd02951271e2a5935836120a4565b61167d7f2ca8e8dfde9481c8a047cde1353357bf2e606d7d1eca452231d961937a4c5aca836120a4565b6116a77ff3de4533ff00ef299a11d619e1a5d244e6ff5fa1f474c653ed54cbb6ef939436836120a4565b6116d17f2455f7a8bbdd0bb4e98fefba1846d37b1c2aaefb411547a266276157e5c75d2d836120a4565b6116fb7f1492d97ab6e4d8c7ca956834bc38263ad70284a7fdf818879444c466f060a873836120a4565b6117257f60a9770968af425ab1edbca869fda04c84d1c0fd21db260dfc186a3ef3e3e14f836120a4565b61174f7ff29bdb744edfeb41e2161a3a29b928fe654603a4e2b5577a7855149e9916a64b836120a4565b6117797f50a9ed8fc1c890456f829cbba972ff82bb1658c43895e7bee5d1fec9871e9b39836120a4565b6117a37f75d435b8ed45738e662759d0e2a87a699b5c6e9cdd9593f483f195bfc764e690836120a4565b609780546001600160a01b0319167103e8000003e80000000a000003e8001275001790558015610b2f576000805461ff00191690555050565b609f5460009060ff1680610d57575050609f54640100000000900460ff1690565b3360009081527f3da570987684dbd89cdc86e6f721d2e0b7865d41bbb84be8fd033708221cb9b6602052604090205460ff166118615760405162461bcd60e51b81526020600482015260036024820152620a462760eb1b604482015260640161075a565b609f546601000000000000900460ff16156118a45760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805466ff000000000000191666010000000000001790556040517f50a9ed8fc1c890456f829cbba972ff82bb1658c43895e7bee5d1fec9871e9b399060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b60008281526065602052604090206001015461192b8133611e7a565b6109b78383611f9c565b609f5460009060ff1680610d57575050609f5462010000900460ff1690565b3360009081527fdac563a5eca333c5ee2ee69b76f4796bd8890408c930745ef9b47200c0b4a121602052604090205460ff166119b75760405162461bcd60e51b81526020600482015260026024820152610a4760f31b604482015260640161075a565b6127108163ffffffff16106119f45760405162461bcd60e51b815260206004820152600360248201526205232360ec1b604482015260640161075a565b6097805467ffffffff00000000191664010000000063ffffffff84169081029190911790915560405133907f456798d7429d6deef71c19b900fa05ce0bc150d970f312fac0396efe0ed89e2f90600090a350565b3360009081527f7a8dde43a7bc7e69e79f4e84c777c056b60ffe4a66e8627aaef837e50f847a24602052604090205460ff16611aab5760405162461bcd60e51b8152602060048201526002602482015261523760f01b604482015260640161075a565b6001600160a01b038116600081815260a06020526040808220805460ff191660011790555133917f0beb05eda27aaa12c3879f90bf15e464bae38f391a8e75a12dc287ac2fdc29b591a350565b3360009081527f77f13b16c87b7f2f2e4e7e8fee3e2c404557d2df5b89ffd3e0e81d5b6a75af32602052604090205460ff16611b5c5760405162461bcd60e51b815260206004820152600360248201526229189b60e91b604482015260640161075a565b609f54640100000000900460ff1615611b9d5760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805464ff0000000019166401000000001790556040517f60a9770968af425ab1edbca869fda04c84d1c0fd21db260dfc186a3ef3e3e14f9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b609f5460009060ff1680610d57575050609f546301000000900460ff1690565b609f5460009060ff1680610d57575050609f546601000000000000900460ff1690565b3360009081527f53ebb4d5020e385d4b47c75dab8fa68f4e9953c2ea2a824d50ad61d7fbe1e85e602052604090205460ff16611cab5760405162461bcd60e51b8152602060048201526003602482015262148c4d60ea1b604482015260640161075a565b609f5462010000900460ff1615611cea5760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805462ff00001916620100001790556040517f2455f7a8bbdd0bb4e98fefba1846d37b1c2aaefb411547a266276157e5c75d2d9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b3360009081527fff6cba3daff300f2d51631d1bfa726734b8a02fb6bf1bfe8fabaa748202a8518602052604090205460ff16611db15760405162461bcd60e51b815260206004820152600360248201526252313760e81b604482015260640161075a565b609f5465010000000000900460ff1615611df35760405162461bcd60e51b815260206004820152600360248201526205231360ec1b604482015260640161075a565b609f805465ff00000000001916650100000000001790556040517ff29bdb744edfeb41e2161a3a29b928fe654603a4e2b5577a7855149e9916a64b9060019033907f6033cdcd2199d6fdde99ce0b60a809d3f980ce9597551944dfd8af7f33ec0a6290600090a4565b609f5460009060ff1680610d57575050609f54610100900460ff1690565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b2f57611eb8816001600160a01b031660146120ae565b611ec38360206120ae565b604051602001611ed49291906123fa565b60408051601f198184030181529082905262461bcd60e51b825261075a9160040161247b565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff16610b2f5760008281526065602090815260408083206001600160a01b03851684529091529020805460ff19166001179055611f583390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526065602090815260408083206001600160a01b038516845290915290205460ff1615610b2f5760008281526065602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600054610100900460ff1661208a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161075a565b61209261225e565b61209a61225e565b6120a261225e565b565b610b2f8282611efa565b606060006120bd8360026125d9565b6120c89060026125c1565b67ffffffffffffffff8111156120e0576120e061266b565b6040519080825280601f01601f19166020018201604052801561210a576020820181803683370190505b509050600360fc1b8160008151811061212557612125612655565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061215457612154612655565b60200101906001600160f81b031916908160001a90535060006121788460026125d9565b6121839060016125c1565b90505b6001811115612208577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106121c4576121c4612655565b1a60f81b8282815181106121da576121da612655565b60200101906001600160f81b031916908160001a90535060049490941c9361220181612628565b9050612186565b5083156122575760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161075a565b9392505050565b600054610100900460ff166120a25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161075a565b80356001600160a01b03811681146122e057600080fd5b919050565b6000602082840312156122f757600080fd5b612257826122c9565b600080600080600060a0868803121561231857600080fd5b612321866122c9565b945061232f602087016122c9565b935061233d604087016122c9565b925061234b606087016122c9565b9150612359608087016122c9565b90509295509295909350565b60006020828403121561237757600080fd5b5035919050565b6000806040838503121561239157600080fd5b823591506123a1602084016122c9565b90509250929050565b6000602082840312156123bc57600080fd5b81356001600160e01b03198116811461225757600080fd5b6000602082840312156123e657600080fd5b813563ffffffff8116811461225757600080fd5b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516124328160178501602088016125f8565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161246f8160288401602088016125f8565b01602801949350505050565b602081526000825180602084015261249a8160408501602087016125f8565b601f01601f19169190910160400192915050565b81516001600160a01b03908116825260208084015182169083015260408084015182169083015260608084015182169083015260808084015182169083015260a08084015182169083015260c080840151918216908301526101208201905060e083015161252460e084018263ffffffff169052565b506101009283015163ffffffff16919092015290565b60006101008201905063ffffffff8084511683528060208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401528060a08501511660a08401525060c08301516125a260c084018263ffffffff169052565b5060e08301516125ba60e084018263ffffffff169052565b5092915050565b600082198211156125d4576125d461263f565b500190565b60008160001904831182151516156125f3576125f361263f565b500290565b60005b838110156126135781810151838201526020016125fb565b83811115612622576000848401525b50505050565b6000816126375761263761263f565b506000190190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212203480ae9c0018a635f2d62eb41a6ba115e842beb89a6ea70a64c888e8a24c230864736f6c63430008050033

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.