S Price: $0.067693 (-2.65%)
Gas: 55 Gwei

Contract

0xdEA0243b5EE5200d1FEBA615eAa7385598417B86

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Receive Message610698902026-01-24 19:43:2536 hrs ago1769283805IN
0xdEA0243b...598417B86
0 S0.015146850
Receive Message608922082026-01-22 1:52:524 days ago1769046772IN
0xdEA0243b...598417B86
0 S0.0160005550
Receive Message605928862026-01-17 21:53:328 days ago1768686812IN
0xdEA0243b...598417B86
0 S0.015150750
Receive Message601549872026-01-11 14:09:4514 days ago1768140585IN
0xdEA0243b...598417B86
0 S0.0164125550
Receive Message599232652026-01-08 14:59:4717 days ago1767884387IN
0xdEA0243b...598417B86
0 S0.0228518666.66666666
Receive Message599229482026-01-08 14:55:1317 days ago1767884113IN
0xdEA0243b...598417B86
0 S0.01519750
Receive Message598785772026-01-08 2:50:3418 days ago1767840634IN
0xdEA0243b...598417B86
0 S0.0160060550
Receive Message595189652026-01-03 18:49:0022 days ago1767466140IN
0xdEA0243b...598417B86
0 S0.01513850
Receive Message582839702025-12-18 19:49:3138 days ago1766087371IN
0xdEA0243b...598417B86
0 S0.0259293481.00666666
Receive Message579912652025-12-15 14:09:4441 days ago1765807784IN
0xdEA0243b...598417B86
0 S0.0160054550
Receive Message570793102025-12-03 19:53:4553 days ago1764791625IN
0xdEA0243b...598417B86
0 S0.015151350
Receive Message568203592025-12-01 4:48:2556 days ago1764564505IN
0xdEA0243b...598417B86
0 S0.0160125550
Receive Message567418532025-11-30 4:35:2557 days ago1764477325IN
0xdEA0243b...598417B86
0 S0.0160540550
Receive Message567069662025-11-29 15:32:1757 days ago1764430337IN
0xdEA0243b...598417B86
0 S0.0158770550
Receive Message562671312025-11-24 5:35:4663 days ago1763962546IN
0xdEA0243b...598417B86
0 S0.0160195550
Receive Message557755022025-11-19 13:34:2667 days ago1763559266IN
0xdEA0243b...598417B86
0 S0.016073750
Receive Message556854822025-11-18 14:58:3068 days ago1763477910IN
0xdEA0243b...598417B86
0 S0.0160251550
Receive Message554097932025-11-16 3:51:4771 days ago1763265107IN
0xdEA0243b...598417B86
0 S0.016073150
Receive Message553847662025-11-15 21:36:2971 days ago1763242589IN
0xdEA0243b...598417B86
0 S0.015159550
Receive Message548586842025-11-11 10:03:3075 days ago1762855410IN
0xdEA0243b...598417B86
0 S0.0160283550
Receive Message546305662025-11-09 22:07:4077 days ago1762726060IN
0xdEA0243b...598417B86
0 S0.015163350
Receive Message539650442025-11-06 13:35:4380 days ago1762436143IN
0xdEA0243b...598417B86
0 S0.016065450
Receive Message539307342025-11-06 9:13:0780 days ago1762420387IN
0xdEA0243b...598417B86
0 S0.016062650
Receive Message539148662025-11-06 7:11:5281 days ago1762413112IN
0xdEA0243b...598417B86
0 S0.0160257550
Receive Message536649392025-11-04 23:19:1982 days ago1762298359IN
0xdEA0243b...598417B86
0 S0.0177242558.46153846
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
611621182026-01-26 3:11:575 hrs ago1769397117
0xdEA0243b...598417B86
0.15 S
611621182026-01-26 3:11:575 hrs ago1769397117
0xdEA0243b...598417B86
0.15 S
610699682026-01-24 19:45:5136 hrs ago1769283951
0xdEA0243b...598417B86
0.15 S
610699682026-01-24 19:45:5136 hrs ago1769283951
0xdEA0243b...598417B86
0.15 S
606188242026-01-18 9:39:387 days ago1768729178
0xdEA0243b...598417B86
0.15 S
606188242026-01-18 9:39:387 days ago1768729178
0xdEA0243b...598417B86
0.15 S
605929182026-01-17 21:54:498 days ago1768686889
0xdEA0243b...598417B86
0.15 S
605929182026-01-17 21:54:498 days ago1768686889
0xdEA0243b...598417B86
0.15 S
601594672026-01-11 15:44:0414 days ago1768146244
0xdEA0243b...598417B86
0.15 S
601594672026-01-11 15:44:0414 days ago1768146244
0xdEA0243b...598417B86
0.15 S
599362192026-01-08 18:27:1417 days ago1767896834
0xdEA0243b...598417B86
0.15 S
599362192026-01-08 18:27:1417 days ago1767896834
0xdEA0243b...598417B86
0.15 S
599247372026-01-08 15:19:0817 days ago1767885548
0xdEA0243b...598417B86
0.15 S
599247372026-01-08 15:19:0817 days ago1767885548
0xdEA0243b...598417B86
0.15 S
595190322026-01-03 18:50:1322 days ago1767466213
0xdEA0243b...598417B86
0.15 S
595190322026-01-03 18:50:1322 days ago1767466213
0xdEA0243b...598417B86
0.15 S
582928682025-12-18 21:44:3538 days ago1766094275
0xdEA0243b...598417B86
0.15 S
582928682025-12-18 21:44:3538 days ago1766094275
0xdEA0243b...598417B86
0.15 S
579917772025-12-15 14:18:2241 days ago1765808302
0xdEA0243b...598417B86
0.15 S
579917772025-12-15 14:18:2241 days ago1765808302
0xdEA0243b...598417B86
0.15 S
570793692025-12-03 19:54:3853 days ago1764791678
0xdEA0243b...598417B86
0.15 S
570793692025-12-03 19:54:3853 days ago1764791678
0xdEA0243b...598417B86
0.15 S
568204682025-12-01 4:50:2356 days ago1764564623
0xdEA0243b...598417B86
0.15 S
568204682025-12-01 4:50:2356 days ago1764564623
0xdEA0243b...598417B86
0.15 S
567418862025-11-30 4:36:1457 days ago1764477374
0xdEA0243b...598417B86
0.15 S
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PolymerAdapter

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.19;

import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {ICrossL2ProverV2} from "./interfaces/ICrossL2ProverV2.sol";
import {BaseAdapter} from "../BaseAdapter.sol";

/// @title Polymer Adapter
/// @notice Adapter contract for cross-chain communication using the Polymer protocol.
contract PolymerAdapter is BaseAdapter, ReentrancyGuard {
    /// @notice Event emitted when a chain ID has been set
    event ChainIdSet(uint256 chainId, bool enabled);

    /// @notice Event emitted when a message is ready to be relayed.
    event RelayViaPolymer(uint256 indexed destChainId, address indexed destAdapter, bytes32 indexed transferId, bytes message);

    /// @notice Error messages when quoted fee after deductions is too low
    error Adapter_FeeTooLow(uint256 minGas, uint256 amount);

    /// @notice Error when the proof is invalid.
    error Adapter_InvalidProof();

    /// @notice Event hash for the RelayViaPolymer event.
    bytes32 public constant RELAY_EVENT_HASH = keccak256("RelayViaPolymer(uint256,address,bytes32,bytes)");

    /// @notice Nonce used in transferId calculation, increments after each calculation.
    uint256 public nonce;

    /// @notice Address of the Polymer Prover contract on the same chain.
    ICrossL2ProverV2 public immutable PROVER;

    /// @notice Maps accesible Polymer chains IDs.
    mapping(uint256 => bool) public supportedChainIds;

    /// @notice Constructor to initialize the PolymerAdapter.
    /// @param _prover Address of the Polymer prover contract on the same chain.
    /// @param name Name of the adapter.
    /// @param minimumGas Minimum gas required to relay a message. Acts as a fixed protocol fee.
    /// @param treasury Address of the treasury.
    /// @param chainIds Array of chain IDs supported by the adapter.
    /// @param owner Owner of the adapter
    constructor(
        address _prover,
        string memory name,
        uint256 minimumGas,
        address treasury,
        uint256[] memory chainIds,
        address owner
    ) BaseAdapter(name, minimumGas, treasury, 0, owner) {
        if (_prover == address(0)) revert Adapter_InvalidParams();
        PROVER = ICrossL2ProverV2(_prover);
        for (uint256 i = 0; i < chainIds.length; i++) {
            supportedChainIds[chainIds[i]] = true;
            emit ChainIdSet(chainIds[i], true);
        }
    }

    /// @notice Emits an event to be relayed to a destination chain using Polymer.
    /// @dev Overloaded function that accepts a RelayedMessage struct so that the Adapter can include msg.sender.
    /// @dev Refunds back to refundAddress any excess gas fees. Returned value is always 0 since no id is produced, should be ignored.
    /// @param destChainId The destination chain ID.
    /// @param destination The destination address.
    /// @param options Additional params to be used by the adapter, abi encoded refund address.
    /// @param message The message data to be relayed.
    /// @return transferId Transfer ID of the relayed message.
    function relayMessage(
        uint256 destChainId,
        address destination,
        bytes memory options,
        bytes memory message
    ) external payable override whenNotPaused nonReentrant returns (bytes32 transferId) {
        // It's permissionless at this point. Msg.sender is encoded to the forwarded message
        address destAdapter = trustedAdapters[destChainId];
        if (!supportedChainIds[destChainId] || destAdapter == address(0)) revert Adapter_InvalidParams(); // Bridge doesn't support this chain id

        bytes memory relayedMessage = abi.encode(BridgedMessage(message, msg.sender, destination));
        _collectAndRefundFees(abi.decode(options, (address)));

        transferId = calculateTransferId(destChainId);
        // Increment nonce used to create transfer id
        nonce++;

        // emit event
        emit RelayViaPolymer(destChainId, destAdapter, transferId, relayedMessage);
    }

    /// @notice Receives a message.
    /// @param proof A hex encoded proof from Polymer.
    function receiveMessage(bytes calldata proof) external virtual whenNotPaused {
        (uint32 originChainId, address sourceAdapter, bytes memory topics, bytes memory unindexedData) = PROVER.validateEvent(proof);
        // If proof is invalid, PROVER.validateEvent() reverts
        address originAdapter = trustedAdapters[originChainId];

        // Decode and verify indexed topics (dest chain id and dest adapter are the same)
        (bytes32 eventHash, uint256 destChainId, address destAdapter, bytes32 transferId) = abi.decode(topics, (bytes32, uint256, address, bytes32));
        if (((destAdapter != address(this)) || (destChainId != block.chainid)) || (originAdapter == address(0)) || (eventHash != RELAY_EVENT_HASH))
            revert Adapter_InvalidProof();

        _registerMessage(sourceAdapter, transferId, abi.decode(unindexedData, (bytes)), originChainId);
    }

    /**
     * @notice Calculates the transfer ID based on the provided parameters.
     * @param destChainId The destination chain ID.
     * @return The calculated transfer ID.
     */
    function calculateTransferId(uint256 destChainId) public view returns (bytes32) {
        return keccak256(abi.encode(destChainId, block.chainid, nonce));
    }

    /// @dev Internal function to collect fees and refund the difference if necessary
    /// @param refundAddress The user address to receive a refund
    function _collectAndRefundFees(address refundAddress) internal {
        uint256 remainingValue = _deductMinGas(msg.value);
        if (remainingValue != 0) {
            // refund excess
            (bool success, ) = refundAddress.call{value: remainingValue}("");
            if (!success) revert Adapter_FeeTransferFailed();
        }
    }

    /// @notice Deducts the protocol fee from the given amount
    /// @dev Internal function that collects the minimumGas and transfers it to the protocol fee recipient
    /// @param amount The amount from which the fee will be deducted
    /// @return The amount after deducting the fee (remaining value)
    function _deductMinGas(uint256 amount) internal returns (uint256) {
        if (amount < minGas && minGas != 0) revert Adapter_FeeTooLow(minGas, amount);
        if (minGas > 0) {
            if (protocolFeeRecipient == address(0)) revert Adapter_FeeTransferFailed();
            // Transfer fee to protocol
            (bool success, ) = protocolFeeRecipient.call{value: minGas}("");
            if (!success) revert Adapter_FeeTransferFailed();
        }
        return amount - minGas;
    }

    /// @notice Sets domain IDs and corresponding chain IDs.
    /// @dev Only the owner can call this function.
    /// @param chainIds Array of chain IDs.
    /// @param enabled Boolean array to enable or disable the chain IDs.
    function setDomainId(uint256[] memory chainIds, bool enabled) external onlyRole(DEFAULT_ADMIN_ROLE) {
        for (uint256 i = 0; i < chainIds.length; i++) {
            supportedChainIds[chainIds[i]] = enabled;
            emit ChainIdSet(chainIds[i], enabled);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.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:
 *
 * ```solidity
 * 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}:
 *
 * ```solidity
 * 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. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    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);
        _;
    }

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

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

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @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 virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.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 virtual 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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    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`.
     *
     * May emit a {RoleRevoked} event.
     */
    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.
     *
     * May emit a {RoleGranted} event.
     *
     * [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.
     *
     * May emit a {RoleGranted} event.
     */
    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.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.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 ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.19 <=0.8.20;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {IController} from "../interfaces/IController.sol";
import {IBaseAdapter} from "./interfaces/IBaseAdapter.sol";

/// @title BaseAdapter
/// @notice Abstract base contract for adapters used to send and receive messages
abstract contract BaseAdapter is IBaseAdapter, Pausable, AccessControl {
    /* ========== EVENTS ========== */

    /// @notice Emitted when the protocol fee is set
    event ProtocolFeeSet(uint48 protocolFee);

    /// @notice Emitted when the minimum gas is set
    event MinGasSet(uint256 minGas);

    event TrustedAdapterSet(address indexed adapter, uint256 chainId);

    /* ========== ERRORS ========== */
    /// @notice Error when the fee transfer fails
    error Adapter_FeeTransferFailed();

    /// @notice Error when the provided value is less than the minimum gas limit
    error Adapter_ValueIsLessThanLimit();

    /// @notice Error when the address is invalid
    error Adapter_InvalidAddress();

    /// @notice Error when the parameters are invalid
    error Adapter_InvalidParams();

    /// @notice Error when the sender is unauthorised to perform an action
    error Adapter_Unauthorised();

    /// @notice Error when the message is invalid
    error Adapter_InvalidMessage();

    /// @notice Error when the Bridge message ID is already processed
    error Adapter_AlreadyProcessed();

    /* ========== STATE VARIABLES ========== */
    /// @notice Stores received transfer IDs to prevent double processing
    mapping(bytes32 => bool) internal _processedTransferIds;

    /// @notice Maps chain ID to the origin forwarder address (trusted adapter on the other network)
    /// @dev Only calls from these addresses are allowed when messages are received
    mapping(uint256 => address) public trustedAdapters;

    bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");

    /// @notice Fee paid to protocol in basis points (3 decimal places)
    uint48 public protocolFee;

    /// @notice Decimal value for fee calculations (one percent equals 1000)
    uint48 public constant FEE_DECIMALS = 1e5;

    /// @notice Address where the protocol receives fees
    address public protocolFeeRecipient;

    /// @notice Minimum relayer fee that will be accepted
    uint256 public minGas;

    /// @notice Name of the adapter
    string public adapterName;

    /// @notice Constructor to initialize the BaseAdapter
    /// @param name Name of the adapter
    /// @param minimumGas Minimum gas required to relay a message
    /// @param treasury Address where the protocol fees are sent
    /// @param fee Fee to be charged by the protocol in basis points
    constructor(string memory name, uint256 minimumGas, address treasury, uint48 fee, address owner) {
        _setupRole(DEFAULT_ADMIN_ROLE, owner);
        _setupRole(PAUSE_ROLE, owner);
        minGas = minimumGas;
        adapterName = name;
        protocolFeeRecipient = treasury;
        protocolFee = fee;

        emit ProtocolFeeSet(fee);
        emit MinGasSet(minimumGas);
    }

    /// @notice Checks if the given adapter is a trusted adapter for the specified chain ID
    /// @param chainId The chain ID to check
    /// @param adapter The adapter address to verify
    /// @return True if the adapter is trusted, false otherwise
    function isTrustedAdapter(uint256 chainId, address adapter) external view returns (bool) {
        return trustedAdapters[chainId] == adapter;
    }

    /// @notice Checks if the given chain ID is supported by the adapter
    /// @param chainId The chain ID to check
    /// @return True if the chain ID is supported, false otherwise
    function isChainIdSupported(uint256 chainId) public view returns (bool) {
        return trustedAdapters[chainId] != address(0);
    }

    /// @notice Registers a received message and processes it
    /// @dev Internal function that checks the origin sender, decodes the message, and processes it through the controller
    /// @param originSender The address of the sender on the origin chain
    /// @param transferId The ID of the transfer
    /// @param message The message data
    /// @param originChain The origin chain ID
    function _registerMessage(address originSender, bytes32 transferId, bytes memory message, uint256 originChain) internal {
        // Origin sender must be a trusted adapter
        if (trustedAdapters[originChain] != originSender) revert Adapter_Unauthorised();
        // Decode message and get the controller
        BridgedMessage memory bridgedMsg = abi.decode(message, (BridgedMessage));

        // If transfer id is already processed, revert
        if (_processedTransferIds[transferId]) revert Adapter_AlreadyProcessed();
        _processedTransferIds[transferId] = true;

        IController(bridgedMsg.destController).receiveMessage(bridgedMsg.message, originChain, bridgedMsg.originController);
    }

    /// @notice Deducts the protocol fee from the given amount
    /// @dev Internal function that checks minimum gas, calculates the fee, and transfers it to the protocol fee recipient
    /// @param amount The amount from which the fee will be deducted
    /// @return The amount after deducting the fee (remaining msg.value)
    function _deductFee(uint256 amount) internal returns (uint256) {
        if (msg.value < minGas && minGas != 0) revert Adapter_ValueIsLessThanLimit();
        if (protocolFeeRecipient == address(0)) revert Adapter_FeeTransferFailed();
        uint256 feeAmount = calculateFee(amount);
        if (feeAmount > 0) {
            // Transfer fee to protocol
            (bool success, ) = protocolFeeRecipient.call{value: feeAmount}("");
            if (!success) revert Adapter_FeeTransferFailed();
        }
        return amount - feeAmount;
    }

    function calculateFee(uint256 amount) public view returns (uint256) {
        if (protocolFee == 0) return 0;
        return Math.mulDiv(amount, protocolFee, FEE_DECIMALS);
    }

    /// @notice Sets the trusted adapter for a specific chain ID
    /// @dev Only callable by the owner
    /// @param chainId The chain ID to set the trusted adapter for
    /// @param trustedAdapter The address of the trusted adapter
    function setTrustedAdapter(uint256 chainId, address trustedAdapter) external onlyRole(DEFAULT_ADMIN_ROLE) {
        trustedAdapters[chainId] = trustedAdapter;
        emit TrustedAdapterSet(trustedAdapter, chainId);
    }

    /// @notice Sets the protocol fee and the recipient address
    /// @dev Only callable by the owner
    /// @param fee The new protocol fee in basis points
    /// @param treasury The address where the protocol fees will be sent
    function setProtocolFee(uint48 fee, address treasury) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (fee > 5e3) revert Adapter_InvalidParams();
        protocolFee = fee;
        protocolFeeRecipient = treasury;
        emit ProtocolFeeSet(fee);
    }

    /// @notice Sets the minimum gas required to relay a message
    /// @dev Only callable by the owner
    /// @param _minGas The new minimum gas value
    function setMinGas(uint256 _minGas) external onlyRole(DEFAULT_ADMIN_ROLE) {
        minGas = _minGas;
        emit MinGasSet(_minGas);
    }

    /// @notice Pauses the contract.
    /// @dev Only a user with a PAUSE_ROLE can call this function.
    function pause() public onlyRole(PAUSE_ROLE) {
        _pause();
    }

    /// @notice Unpauses the contract.
    /// @dev Only a user with a PAUSE_ROLE can call this function.
    function unpause() public onlyRole(PAUSE_ROLE) {
        _unpause();
    }

    ///@dev Fallback function to receive ether from bridge refunds
    receive() external payable {}
}

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.19 <=0.8.20;

interface IBaseAdapter {
    /// @notice Struct used by the adapter to relay messages
    struct BridgedMessage {
        bytes message;
        address originController;
        address destController;
    }

    /// @param destChainId The destination chain ID.
    /// @param destination The destination address.
    /// @param options Additional options to be used by the adapter.
    /// @param message The message data to be relayed.
    /// @return transferId The transfer ID of the relayed message.
    function relayMessage(
        uint256 destChainId,
        address destination,
        bytes memory options,
        bytes calldata message
    ) external payable returns (bytes32 transferId);

    /// @param chainId The chain ID to check.
    /// @return bool True if the chain ID is supported, false otherwise.
    function isChainIdSupported(uint256 chainId) external view returns (bool);
}

// SPDX-License-Identifier: Apache-2.0
/*
 * Copyright 2024, Polymer Labs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
pragma solidity ^0.8.0;

/**
 * @title ICrossL2Prover
 * @author Polymer Labs
 * @notice A contract that can prove peptides state. Since peptide is an aggregator of many chains' states, this
 * contract can in turn be used to prove any arbitrary events and/or storage on counterparty chains.
 */
interface ICrossL2ProverV2 {
    /**
     * @notice A a log at a given raw rlp encoded receipt at a given logIndex within the receipt.
     * @notice the receiptRLP should first be validated by calling validateReceipt.
     * @param proof: The proof of a given rlp bytes for the receipt, returned from the receipt MMPT of a block.
     * @return chainId The chainID that the proof proves the log for
     * @return emittingContract The address of the contract that emitted the log on the source chain
     * @return topics The topics of the event. First topic is the event signature that can be calculated by
     * Event.selector. The remaining elements in this array are the indexed parameters of the event.
     * @return unindexedData // The abi encoded non-indexed parameters of the event.
     */
    function validateEvent(
        bytes calldata proof
    ) external view returns (uint32 chainId, address emittingContract, bytes calldata topics, bytes calldata unindexedData);

    /**
     * Return srcChain, Block Number, Receipt Index, and Local Index for a requested proof
     */
    function inspectLogIdentifier(
        bytes calldata proof
    ) external pure returns (uint32 srcChain, uint64 blockNumber, uint16 receiptIndex, uint8 logIndex);

    /**
     * Return polymer state root, height , and signature over height and root which can be verified by
     * crypto.pubkey(keccak(peptideStateRoot, peptideHeight))
     */
    function inspectPolymerState(bytes calldata proof) external pure returns (bytes32 stateRoot, uint64 height, bytes memory signature);
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <=0.8.20;

interface IController {
    /**
     * @notice Registers a received message.
     * @param message The received message data in bytes.
     * @param originChain The origin chain ID.
     * @param originSender The address of the origin sender. (controller in origin chain)
     */
    function receiveMessage(bytes calldata message, uint256 originChain, address originSender) external;

    /**
     * @notice Returns the controller address for a given chain ID.
     * @param chainId The chain ID.
     * @return The controller address.
     */
    function getControllerForChain(uint256 chainId) external view returns (address);
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_prover","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"minimumGas","type":"uint256"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"uint256[]","name":"chainIds","type":"uint256[]"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Adapter_AlreadyProcessed","type":"error"},{"inputs":[{"internalType":"uint256","name":"minGas","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Adapter_FeeTooLow","type":"error"},{"inputs":[],"name":"Adapter_FeeTransferFailed","type":"error"},{"inputs":[],"name":"Adapter_InvalidAddress","type":"error"},{"inputs":[],"name":"Adapter_InvalidMessage","type":"error"},{"inputs":[],"name":"Adapter_InvalidParams","type":"error"},{"inputs":[],"name":"Adapter_InvalidProof","type":"error"},{"inputs":[],"name":"Adapter_Unauthorised","type":"error"},{"inputs":[],"name":"Adapter_ValueIsLessThanLimit","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ChainIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minGas","type":"uint256"}],"name":"MinGasSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint48","name":"protocolFee","type":"uint48"}],"name":"ProtocolFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"destChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"destAdapter","type":"address"},{"indexed":true,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"RelayViaPolymer","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adapter","type":"address"},{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"TrustedAdapterSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DECIMALS","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVER","outputs":[{"internalType":"contract ICrossL2ProverV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RELAY_EVENT_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adapterName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"calculateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"destChainId","type":"uint256"}],"name":"calculateTransferId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"uint256","name":"chainId","type":"uint256"}],"name":"isChainIdSupported","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"adapter","type":"address"}],"name":"isTrustedAdapter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minGas","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFee","outputs":[{"internalType":"uint48","name":"","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"proof","type":"bytes"}],"name":"receiveMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"destChainId","type":"uint256"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"bytes","name":"options","type":"bytes"},{"internalType":"bytes","name":"message","type":"bytes"}],"name":"relayMessage","outputs":[{"internalType":"bytes32","name":"transferId","type":"bytes32"}],"stateMutability":"payable","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":"uint256[]","name":"chainIds","type":"uint256[]"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setDomainId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minGas","type":"uint256"}],"name":"setMinGas","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint48","name":"fee","type":"uint48"},{"internalType":"address","name":"treasury","type":"address"}],"name":"setProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"trustedAdapter","type":"address"}],"name":"setTrustedAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"supportedChainIds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"trustedAdapters","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b50604051620024bb380380620024bb8339810160408190526200003491620003cf565b6000805460ff191681558590859085908462000051828262000249565b6200007d7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d8262000249565b600584905560066200009086826200057d565b50600480546001600160d01b03191666010000000000006001600160a01b0386160265ffffffffffff19161765ffffffffffff84169081179091556040519081527f4fd70f6705b1f3e08635e8fc333448a5e0840fbed285ff79cd276b18f4fd339b9060200160405180910390a16040518481527f0b6ee1e44e857501b808f1db1cc3b359ebfe9f791e3d10ba312a06098e8bda3a9060200160405180910390a1505060016007555050506001600160a01b038616620001635760405163a973f23760e01b815260040160405180910390fd5b6001600160a01b03861660805260005b82518110156200023c5760016009600085848151811062000198576200019862000649565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2db500722d757e770341f8c3f7d6bb28d1d238cd104ad294e71782ce4888a0db838281518110620001fb57620001fb62000649565b602002602001015160016040516200021f9291909182521515602082015260400190565b60405180910390a18062000233816200065f565b91505062000173565b5050505050505062000687565b62000255828262000259565b5050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff16620002555760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b80516001600160a01b0381168114620002f957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156200033f576200033f620002fe565b604052919050565b600082601f8301126200035957600080fd5b815160206001600160401b03821115620003775762000377620002fe565b8160051b6200038882820162000314565b9283528481018201928281019087851115620003a357600080fd5b83870192505b84831015620003c457825182529183019190830190620003a9565b979650505050505050565b60008060008060008060c08789031215620003e957600080fd5b620003f487620002e1565b602088810151919750906001600160401b03808211156200041457600080fd5b818a0191508a601f8301126200042957600080fd5b8151818111156200043e576200043e620002fe565b62000452601f8201601f1916850162000314565b8181528c858386010111156200046757600080fd5b60005b82811015620004875784810186015182820187015285016200046a565b506000858383010152809950505060408a01519650620004aa60608b01620002e1565b955060808a0151925080831115620004c157600080fd5b5050620004d189828a0162000347565b925050620004e260a08801620002e1565b90509295509295509295565b600181811c908216806200050357607f821691505b6020821081036200052457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200057857600081815260208120601f850160051c81016020861015620005535750805b601f850160051c820191505b8181101562000574578281556001016200055f565b5050505b505050565b81516001600160401b03811115620005995762000599620002fe565b620005b181620005aa8454620004ee565b846200052a565b602080601f831160018114620005e95760008415620005d05750858301515b600019600386901b1c1916600185901b17855562000574565b600085815260208120601f198616915b828110156200061a57888601518255948401946001909101908401620005f9565b5085821015620006395787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b6000600182016200068057634e487b7160e01b600052601160045260246000fd5b5060010190565b608051611e11620006aa600039600081816105e20152610ca20152611e116000f3fe6080604052600436106101dc5760003560e01c806391d1485411610102578063ba28657811610095578063df92f85611610064578063df92f856146105d0578063f56423b314610604578063f7566c0314610638578063f953cec71461065857600080fd5b8063ba28657814610561578063be37757a14610583578063ccf288c614610599578063d547741f146105b057600080fd5b8063a4cbec73116100d1578063a4cbec73146104e2578063ad80e451146104f5578063affed0e014610515578063b0e21e8a1461052b57600080fd5b806391d148541461046d57806399a5d7471461048d578063a217fddf146104ad578063a2434722146104c257600080fd5b80635633cb991161017a5780637256d872116101495780637256d872146103c65780637fe3453a146103e65780638456cb591461042257806389ed43981461043757600080fd5b80635633cb99146103175780635c975abb1461034f5780635d87d8841461036757806364df049e1461038757600080fd5b806336568abe116101b657806336568abe1461027e578063389ed2671461029e5780633f4ba83a146102d25780634cf2ab32146102e757600080fd5b806301ffc9a7146101e8578063248a9ca31461021d5780632f2ff15d1461025c57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610208610203366004611619565b610678565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5061024e610238366004611643565b6000908152600160208190526040909120015490565b604051908152602001610214565b34801561026857600080fd5b5061027c610277366004611671565b6106af565b005b34801561028a57600080fd5b5061027c610299366004611671565b6106da565b3480156102aa57600080fd5b5061024e7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d81565b3480156102de57600080fd5b5061027c61075d565b3480156102f357600080fd5b50610208610302366004611643565b60096020526000908152604090205460ff1681565b34801561032357600080fd5b50610208610332366004611643565b6000908152600360205260409020546001600160a01b0316151590565b34801561035b57600080fd5b5060005460ff16610208565b34801561037357600080fd5b5061027c6103823660046116a1565b610792565b34801561039357600080fd5b506004546103ae90600160301b90046001600160a01b031681565b6040516001600160a01b039091168152602001610214565b3480156103d257600080fd5b5061024e6103e1366004611643565b61082f565b3480156103f257600080fd5b50610208610401366004611671565b600091825260036020526040909120546001600160a01b0390811691161490565b34801561042e57600080fd5b5061027c610876565b34801561044357600080fd5b506103ae610452366004611643565b6003602052600090815260409020546001600160a01b031681565b34801561047957600080fd5b50610208610488366004611671565b6108a8565b34801561049957600080fd5b5061024e6104a8366004611643565b6108d3565b3480156104b957600080fd5b5061024e600081565b3480156104ce57600080fd5b5061027c6104dd366004611671565b610909565b61024e6104f036600461179f565b610977565b34801561050157600080fd5b5061027c610510366004611643565b610ac7565b34801561052157600080fd5b5061024e60085481565b34801561053757600080fd5b5060045461054a9065ffffffffffff1681565b60405165ffffffffffff9091168152602001610214565b34801561056d57600080fd5b50610576610b0e565b604051610214919061186f565b34801561058f57600080fd5b5061024e60055481565b3480156105a557600080fd5b5061054a620186a081565b3480156105bc57600080fd5b5061027c6105cb366004611671565b610b9c565b3480156105dc57600080fd5b506103ae7f000000000000000000000000000000000000000000000000000000000000000081565b34801561061057600080fd5b5061024e7f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd681565b34801561064457600080fd5b5061027c610653366004611897565b610bc2565b34801561066457600080fd5b5061027c61067336600461194f565b610c92565b60006001600160e01b03198216637965db0b60e01b14806106a957506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260016020819052604090912001546106cb81610e31565b6106d58383610e3b565b505050565b6001600160a01b038116331461074f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107598282610ea6565b5050565b7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d61078781610e31565b61078f610f0d565b50565b600061079d81610e31565b6113888365ffffffffffff1611156107c85760405163a973f23760e01b815260040160405180910390fd5b6004805465ffffffffffff85166001600160d01b03199091168117600160301b6001600160a01b03861602179091556040519081527f4fd70f6705b1f3e08635e8fc333448a5e0840fbed285ff79cd276b18f4fd339b9060200160405180910390a1505050565b60008146600854604051602001610859939291909283526020830191909152604082015260600190565b604051602081830303815290604052805190602001209050919050565b7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d6108a081610e31565b61078f610f5f565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60045460009065ffffffffffff1681036108ef57506000919050565b6004546106a990839065ffffffffffff16620186a0610f9c565b600061091481610e31565b60008381526003602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591518581527fe1a1a7467c58789fcc937e9eea10913d6a6600e3a4f51ac0050f93035563183e910160405180910390a2505050565b600061098161108c565b6109896110d4565b6000858152600360209081526040808320546009909252909120546001600160a01b039091169060ff1615806109c657506001600160a01b038116155b156109e45760405163a973f23760e01b815260040160405180910390fd5b60006040518060600160405280858152602001336001600160a01b03168152602001876001600160a01b0316815250604051602001610a2391906119c1565b6040516020818303038152906040529050610a5085806020019051810190610a4b9190611a0d565b61112d565b610a598761082f565b600880549194506000610a6b83611a40565b919050555082826001600160a01b0316887f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd684604051610aab919061186f565b60405180910390a45050610abf6001600755565b949350505050565b6000610ad281610e31565b60058290556040518281527f0b6ee1e44e857501b808f1db1cc3b359ebfe9f791e3d10ba312a06098e8bda3a9060200160405180910390a15050565b60068054610b1b90611a59565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4790611a59565b8015610b945780601f10610b6957610100808354040283529160200191610b94565b820191906000526020600020905b815481529060010190602001808311610b7757829003601f168201915b505050505081565b60008281526001602081905260409091200154610bb881610e31565b6106d58383610ea6565b6000610bcd81610e31565b60005b8351811015610c8c578260096000868481518110610bf057610bf0611a93565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2db500722d757e770341f8c3f7d6bb28d1d238cd104ad294e71782ce4888a0db848281518110610c5057610c50611a93565b602002602001015184604051610c729291909182521515602082015260400190565b60405180910390a180610c8481611a40565b915050610bd0565b50505050565b610c9a61108c565b6000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630b9ca54a87876040518363ffffffff1660e01b8152600401610cee929190611aa9565b600060405180830381865afa158015610d0b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d339190810190611b1d565b63ffffffff841660009081526003602090815260408220548451969a509498509296509094506001600160a01b0390921692829182918291610d7b9189018101908901611ba5565b9350935093509350306001600160a01b0316826001600160a01b0316141580610da45750468314155b80610db657506001600160a01b038516155b80610de157507f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd68414155b15610dff57604051635f5cd43960e11b815260040160405180910390fd5b610e24888288806020019051810190610e189190611be4565b8c63ffffffff166111b4565b5050505050505050505050565b61078f81336112c5565b610e4582826108a8565b6107595760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610eb082826108a8565b156107595760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610f1561131e565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610f6761108c565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f423390565b6000808060001985870985870292508281108382030391505080600003610fd657838281610fcc57610fcc611c19565b0492505050611085565b80841161101d5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610746565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b60005460ff16156110d25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610746565b565b6002600754036111265760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610746565b6002600755565b600061113834611367565b90508015610759576000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461118d576040519150601f19603f3d011682016040523d82523d6000602084013e611192565b606091505b50509050806106d5576040516329719bab60e01b815260040160405180910390fd5b6000818152600360205260409020546001600160a01b038581169116146111ee57604051633202886560e11b815260040160405180910390fd5b6000828060200190518101906112049190611c2f565b60008581526002602052604090205490915060ff1615611237576040516345a5050b60e11b815260040160405180910390fd5b600084815260026020908152604091829020805460ff1916600117905582820151835191840151925163734afa2b60e01b81526001600160a01b039091169263734afa2b9261128c9290918791600401611cdf565b600060405180830381600087803b1580156112a657600080fd5b505af11580156112ba573d6000803e3d6000fd5b505050505050505050565b6112cf82826108a8565b610759576112dc8161146b565b6112e783602061147d565b6040516020016112f8929190611d12565b60408051601f198184030181529082905262461bcd60e51b82526107469160040161186f565b60005460ff166110d25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610746565b60006005548210801561137b575060055415155b156113a757600554604051636d44c87760e01b8152600481019190915260248101839052604401610746565b6005541561145e57600454600160301b90046001600160a01b03166113df576040516329719bab60e01b815260040160405180910390fd5b600454600554604051600092600160301b90046001600160a01b031691908381818185875af1925050503d8060008114611435576040519150601f19603f3d011682016040523d82523d6000602084013e61143a565b606091505b505090508061145c576040516329719bab60e01b815260040160405180910390fd5b505b6005546106a99083611d87565b60606106a96001600160a01b03831660145b6060600061148c836002611d9a565b611497906002611db1565b67ffffffffffffffff8111156114af576114af6116da565b6040519080825280601f01601f1916602001820160405280156114d9576020820181803683370190505b509050600360fc1b816000815181106114f4576114f4611a93565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061152357611523611a93565b60200101906001600160f81b031916908160001a9053506000611547846002611d9a565b611552906001611db1565b90505b60018111156115ca576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061158657611586611a93565b1a60f81b82828151811061159c5761159c611a93565b60200101906001600160f81b031916908160001a90535060049490941c936115c381611dc4565b9050611555565b5083156110855760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610746565b60006020828403121561162b57600080fd5b81356001600160e01b03198116811461108557600080fd5b60006020828403121561165557600080fd5b5035919050565b6001600160a01b038116811461078f57600080fd5b6000806040838503121561168457600080fd5b8235915060208301356116968161165c565b809150509250929050565b600080604083850312156116b457600080fd5b823565ffffffffffff811681146116ca57600080fd5b915060208301356116968161165c565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611719576117196116da565b604052919050565b600067ffffffffffffffff82111561173b5761173b6116da565b50601f01601f191660200190565b600082601f83011261175a57600080fd5b813561176d61176882611721565b6116f0565b81815284602083860101111561178257600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156117b557600080fd5b8435935060208501356117c78161165c565b9250604085013567ffffffffffffffff808211156117e457600080fd5b6117f088838901611749565b9350606087013591508082111561180657600080fd5b5061181387828801611749565b91505092959194509250565b60005b8381101561183a578181015183820152602001611822565b50506000910152565b6000815180845261185b81602086016020860161181f565b601f01601f19169290920160200192915050565b6020815260006110856020830184611843565b8035801515811461189257600080fd5b919050565b600080604083850312156118aa57600080fd5b823567ffffffffffffffff808211156118c257600080fd5b818501915085601f8301126118d657600080fd5b81356020828211156118ea576118ea6116da565b8160051b92506118fb8184016116f0565b828152928401810192818101908985111561191557600080fd5b948201945b848610156119335785358252948201949082019061191a565b96506119429050878201611882565b9450505050509250929050565b6000806020838503121561196257600080fd5b823567ffffffffffffffff8082111561197a57600080fd5b818501915085601f83011261198e57600080fd5b81358181111561199d57600080fd5b8660208285010111156119af57600080fd5b60209290920196919550909350505050565b6020815260008251606060208401526119dd6080840182611843565b60208501516001600160a01b03908116604086810191909152909501519094166060909301929092525090919050565b600060208284031215611a1f57600080fd5b81516110858161165c565b634e487b7160e01b600052601160045260246000fd5b600060018201611a5257611a52611a2a565b5060010190565b600181811c90821680611a6d57607f821691505b602082108103611a8d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082601f830112611ae957600080fd5b8151611af761176882611721565b818152846020838601011115611b0c57600080fd5b610abf82602083016020870161181f565b60008060008060808587031215611b3357600080fd5b845163ffffffff81168114611b4757600080fd5b6020860151909450611b588161165c565b604086015190935067ffffffffffffffff80821115611b7657600080fd5b611b8288838901611ad8565b93506060870151915080821115611b9857600080fd5b5061181387828801611ad8565b60008060008060808587031215611bbb57600080fd5b84519350602085015192506040850151611bd48161165c565b6060959095015193969295505050565b600060208284031215611bf657600080fd5b815167ffffffffffffffff811115611c0d57600080fd5b610abf84828501611ad8565b634e487b7160e01b600052601260045260246000fd5b600060208284031215611c4157600080fd5b815167ffffffffffffffff80821115611c5957600080fd5b9083019060608286031215611c6d57600080fd5b604051606081018181108382111715611c8857611c886116da565b604052825182811115611c9a57600080fd5b611ca687828601611ad8565b82525060208301519150611cb98261165c565b81602082015260408301519250611ccf8361165c565b6040810192909252509392505050565b606081526000611cf26060830186611843565b6020830194909452506001600160a01b0391909116604090910152919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d4a81601785016020880161181f565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611d7b81602884016020880161181f565b01602801949350505050565b818103818111156106a9576106a9611a2a565b80820281158282048414176106a9576106a9611a2a565b808201808211156106a9576106a9611a2a565b600081611dd357611dd3611a2a565b50600019019056fea26469706673582212203013654310ab9859c96b82e6ed92ddd3373144ebea32574666ed57c3957e467564736f6c6343000813003300000000000000000000000095cceae71605c5d97a0ac0ea13013b058729d07500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000214e8348c4f0000000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b250000000000000000000000000000000000000000000000000000000000000100000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a879420000000000000000000000000000000000000000000000000000000000000012506f6c796d657220416461707465722076320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000a4b100000000000000000000000000000000000000000000000000000000000021050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000013e310000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000138de00000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000d0a0000000000000000000000000000000000000000000000000000000000000097000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000003e7

Deployed Bytecode

0x6080604052600436106101dc5760003560e01c806391d1485411610102578063ba28657811610095578063df92f85611610064578063df92f856146105d0578063f56423b314610604578063f7566c0314610638578063f953cec71461065857600080fd5b8063ba28657814610561578063be37757a14610583578063ccf288c614610599578063d547741f146105b057600080fd5b8063a4cbec73116100d1578063a4cbec73146104e2578063ad80e451146104f5578063affed0e014610515578063b0e21e8a1461052b57600080fd5b806391d148541461046d57806399a5d7471461048d578063a217fddf146104ad578063a2434722146104c257600080fd5b80635633cb991161017a5780637256d872116101495780637256d872146103c65780637fe3453a146103e65780638456cb591461042257806389ed43981461043757600080fd5b80635633cb99146103175780635c975abb1461034f5780635d87d8841461036757806364df049e1461038757600080fd5b806336568abe116101b657806336568abe1461027e578063389ed2671461029e5780633f4ba83a146102d25780634cf2ab32146102e757600080fd5b806301ffc9a7146101e8578063248a9ca31461021d5780632f2ff15d1461025c57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50610208610203366004611619565b610678565b60405190151581526020015b60405180910390f35b34801561022957600080fd5b5061024e610238366004611643565b6000908152600160208190526040909120015490565b604051908152602001610214565b34801561026857600080fd5b5061027c610277366004611671565b6106af565b005b34801561028a57600080fd5b5061027c610299366004611671565b6106da565b3480156102aa57600080fd5b5061024e7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d81565b3480156102de57600080fd5b5061027c61075d565b3480156102f357600080fd5b50610208610302366004611643565b60096020526000908152604090205460ff1681565b34801561032357600080fd5b50610208610332366004611643565b6000908152600360205260409020546001600160a01b0316151590565b34801561035b57600080fd5b5060005460ff16610208565b34801561037357600080fd5b5061027c6103823660046116a1565b610792565b34801561039357600080fd5b506004546103ae90600160301b90046001600160a01b031681565b6040516001600160a01b039091168152602001610214565b3480156103d257600080fd5b5061024e6103e1366004611643565b61082f565b3480156103f257600080fd5b50610208610401366004611671565b600091825260036020526040909120546001600160a01b0390811691161490565b34801561042e57600080fd5b5061027c610876565b34801561044357600080fd5b506103ae610452366004611643565b6003602052600090815260409020546001600160a01b031681565b34801561047957600080fd5b50610208610488366004611671565b6108a8565b34801561049957600080fd5b5061024e6104a8366004611643565b6108d3565b3480156104b957600080fd5b5061024e600081565b3480156104ce57600080fd5b5061027c6104dd366004611671565b610909565b61024e6104f036600461179f565b610977565b34801561050157600080fd5b5061027c610510366004611643565b610ac7565b34801561052157600080fd5b5061024e60085481565b34801561053757600080fd5b5060045461054a9065ffffffffffff1681565b60405165ffffffffffff9091168152602001610214565b34801561056d57600080fd5b50610576610b0e565b604051610214919061186f565b34801561058f57600080fd5b5061024e60055481565b3480156105a557600080fd5b5061054a620186a081565b3480156105bc57600080fd5b5061027c6105cb366004611671565b610b9c565b3480156105dc57600080fd5b506103ae7f00000000000000000000000095cceae71605c5d97a0ac0ea13013b058729d07581565b34801561061057600080fd5b5061024e7f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd681565b34801561064457600080fd5b5061027c610653366004611897565b610bc2565b34801561066457600080fd5b5061027c61067336600461194f565b610c92565b60006001600160e01b03198216637965db0b60e01b14806106a957506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260016020819052604090912001546106cb81610e31565b6106d58383610e3b565b505050565b6001600160a01b038116331461074f5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6107598282610ea6565b5050565b7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d61078781610e31565b61078f610f0d565b50565b600061079d81610e31565b6113888365ffffffffffff1611156107c85760405163a973f23760e01b815260040160405180910390fd5b6004805465ffffffffffff85166001600160d01b03199091168117600160301b6001600160a01b03861602179091556040519081527f4fd70f6705b1f3e08635e8fc333448a5e0840fbed285ff79cd276b18f4fd339b9060200160405180910390a1505050565b60008146600854604051602001610859939291909283526020830191909152604082015260600190565b604051602081830303815290604052805190602001209050919050565b7f139c2898040ef16910dc9f44dc697df79363da767d8bc92f2e310312b816e46d6108a081610e31565b61078f610f5f565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60045460009065ffffffffffff1681036108ef57506000919050565b6004546106a990839065ffffffffffff16620186a0610f9c565b600061091481610e31565b60008381526003602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591518581527fe1a1a7467c58789fcc937e9eea10913d6a6600e3a4f51ac0050f93035563183e910160405180910390a2505050565b600061098161108c565b6109896110d4565b6000858152600360209081526040808320546009909252909120546001600160a01b039091169060ff1615806109c657506001600160a01b038116155b156109e45760405163a973f23760e01b815260040160405180910390fd5b60006040518060600160405280858152602001336001600160a01b03168152602001876001600160a01b0316815250604051602001610a2391906119c1565b6040516020818303038152906040529050610a5085806020019051810190610a4b9190611a0d565b61112d565b610a598761082f565b600880549194506000610a6b83611a40565b919050555082826001600160a01b0316887f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd684604051610aab919061186f565b60405180910390a45050610abf6001600755565b949350505050565b6000610ad281610e31565b60058290556040518281527f0b6ee1e44e857501b808f1db1cc3b359ebfe9f791e3d10ba312a06098e8bda3a9060200160405180910390a15050565b60068054610b1b90611a59565b80601f0160208091040260200160405190810160405280929190818152602001828054610b4790611a59565b8015610b945780601f10610b6957610100808354040283529160200191610b94565b820191906000526020600020905b815481529060010190602001808311610b7757829003601f168201915b505050505081565b60008281526001602081905260409091200154610bb881610e31565b6106d58383610ea6565b6000610bcd81610e31565b60005b8351811015610c8c578260096000868481518110610bf057610bf0611a93565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055507f2db500722d757e770341f8c3f7d6bb28d1d238cd104ad294e71782ce4888a0db848281518110610c5057610c50611a93565b602002602001015184604051610c729291909182521515602082015260400190565b60405180910390a180610c8481611a40565b915050610bd0565b50505050565b610c9a61108c565b6000806000807f00000000000000000000000095cceae71605c5d97a0ac0ea13013b058729d0756001600160a01b0316630b9ca54a87876040518363ffffffff1660e01b8152600401610cee929190611aa9565b600060405180830381865afa158015610d0b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d339190810190611b1d565b63ffffffff841660009081526003602090815260408220548451969a509498509296509094506001600160a01b0390921692829182918291610d7b9189018101908901611ba5565b9350935093509350306001600160a01b0316826001600160a01b0316141580610da45750468314155b80610db657506001600160a01b038516155b80610de157507f2e66baff9bca7b0ed067f2937843326d370d318d11f7748dd837f7fea9bcdfd68414155b15610dff57604051635f5cd43960e11b815260040160405180910390fd5b610e24888288806020019051810190610e189190611be4565b8c63ffffffff166111b4565b5050505050505050505050565b61078f81336112c5565b610e4582826108a8565b6107595760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610eb082826108a8565b156107595760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b610f1561131e565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b610f6761108c565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610f423390565b6000808060001985870985870292508281108382030391505080600003610fd657838281610fcc57610fcc611c19565b0492505050611085565b80841161101d5760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610746565b600084868809851960019081018716968790049682860381900495909211909303600082900391909104909201919091029190911760038402600290811880860282030280860282030280860282030280860282030280860282030280860290910302029150505b9392505050565b60005460ff16156110d25760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610746565b565b6002600754036111265760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610746565b6002600755565b600061113834611367565b90508015610759576000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461118d576040519150601f19603f3d011682016040523d82523d6000602084013e611192565b606091505b50509050806106d5576040516329719bab60e01b815260040160405180910390fd5b6000818152600360205260409020546001600160a01b038581169116146111ee57604051633202886560e11b815260040160405180910390fd5b6000828060200190518101906112049190611c2f565b60008581526002602052604090205490915060ff1615611237576040516345a5050b60e11b815260040160405180910390fd5b600084815260026020908152604091829020805460ff1916600117905582820151835191840151925163734afa2b60e01b81526001600160a01b039091169263734afa2b9261128c9290918791600401611cdf565b600060405180830381600087803b1580156112a657600080fd5b505af11580156112ba573d6000803e3d6000fd5b505050505050505050565b6112cf82826108a8565b610759576112dc8161146b565b6112e783602061147d565b6040516020016112f8929190611d12565b60408051601f198184030181529082905262461bcd60e51b82526107469160040161186f565b60005460ff166110d25760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610746565b60006005548210801561137b575060055415155b156113a757600554604051636d44c87760e01b8152600481019190915260248101839052604401610746565b6005541561145e57600454600160301b90046001600160a01b03166113df576040516329719bab60e01b815260040160405180910390fd5b600454600554604051600092600160301b90046001600160a01b031691908381818185875af1925050503d8060008114611435576040519150601f19603f3d011682016040523d82523d6000602084013e61143a565b606091505b505090508061145c576040516329719bab60e01b815260040160405180910390fd5b505b6005546106a99083611d87565b60606106a96001600160a01b03831660145b6060600061148c836002611d9a565b611497906002611db1565b67ffffffffffffffff8111156114af576114af6116da565b6040519080825280601f01601f1916602001820160405280156114d9576020820181803683370190505b509050600360fc1b816000815181106114f4576114f4611a93565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061152357611523611a93565b60200101906001600160f81b031916908160001a9053506000611547846002611d9a565b611552906001611db1565b90505b60018111156115ca576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061158657611586611a93565b1a60f81b82828151811061159c5761159c611a93565b60200101906001600160f81b031916908160001a90535060049490941c936115c381611dc4565b9050611555565b5083156110855760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610746565b60006020828403121561162b57600080fd5b81356001600160e01b03198116811461108557600080fd5b60006020828403121561165557600080fd5b5035919050565b6001600160a01b038116811461078f57600080fd5b6000806040838503121561168457600080fd5b8235915060208301356116968161165c565b809150509250929050565b600080604083850312156116b457600080fd5b823565ffffffffffff811681146116ca57600080fd5b915060208301356116968161165c565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611719576117196116da565b604052919050565b600067ffffffffffffffff82111561173b5761173b6116da565b50601f01601f191660200190565b600082601f83011261175a57600080fd5b813561176d61176882611721565b6116f0565b81815284602083860101111561178257600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080608085870312156117b557600080fd5b8435935060208501356117c78161165c565b9250604085013567ffffffffffffffff808211156117e457600080fd5b6117f088838901611749565b9350606087013591508082111561180657600080fd5b5061181387828801611749565b91505092959194509250565b60005b8381101561183a578181015183820152602001611822565b50506000910152565b6000815180845261185b81602086016020860161181f565b601f01601f19169290920160200192915050565b6020815260006110856020830184611843565b8035801515811461189257600080fd5b919050565b600080604083850312156118aa57600080fd5b823567ffffffffffffffff808211156118c257600080fd5b818501915085601f8301126118d657600080fd5b81356020828211156118ea576118ea6116da565b8160051b92506118fb8184016116f0565b828152928401810192818101908985111561191557600080fd5b948201945b848610156119335785358252948201949082019061191a565b96506119429050878201611882565b9450505050509250929050565b6000806020838503121561196257600080fd5b823567ffffffffffffffff8082111561197a57600080fd5b818501915085601f83011261198e57600080fd5b81358181111561199d57600080fd5b8660208285010111156119af57600080fd5b60209290920196919550909350505050565b6020815260008251606060208401526119dd6080840182611843565b60208501516001600160a01b03908116604086810191909152909501519094166060909301929092525090919050565b600060208284031215611a1f57600080fd5b81516110858161165c565b634e487b7160e01b600052601160045260246000fd5b600060018201611a5257611a52611a2a565b5060010190565b600181811c90821680611a6d57607f821691505b602082108103611a8d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082601f830112611ae957600080fd5b8151611af761176882611721565b818152846020838601011115611b0c57600080fd5b610abf82602083016020870161181f565b60008060008060808587031215611b3357600080fd5b845163ffffffff81168114611b4757600080fd5b6020860151909450611b588161165c565b604086015190935067ffffffffffffffff80821115611b7657600080fd5b611b8288838901611ad8565b93506060870151915080821115611b9857600080fd5b5061181387828801611ad8565b60008060008060808587031215611bbb57600080fd5b84519350602085015192506040850151611bd48161165c565b6060959095015193969295505050565b600060208284031215611bf657600080fd5b815167ffffffffffffffff811115611c0d57600080fd5b610abf84828501611ad8565b634e487b7160e01b600052601260045260246000fd5b600060208284031215611c4157600080fd5b815167ffffffffffffffff80821115611c5957600080fd5b9083019060608286031215611c6d57600080fd5b604051606081018181108382111715611c8857611c886116da565b604052825182811115611c9a57600080fd5b611ca687828601611ad8565b82525060208301519150611cb98261165c565b81602082015260408301519250611ccf8361165c565b6040810192909252509392505050565b606081526000611cf26060830186611843565b6020830194909452506001600160a01b0391909116604090910152919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611d4a81601785016020880161181f565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611d7b81602884016020880161181f565b01602801949350505050565b818103818111156106a9576106a9611a2a565b80820281158282048414176106a9576106a9611a2a565b808201808211156106a9576106a9611a2a565b600081611dd357611dd3611a2a565b50600019019056fea26469706673582212203013654310ab9859c96b82e6ed92ddd3373144ebea32574666ed57c3957e467564736f6c63430008130033

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

00000000000000000000000095cceae71605c5d97a0ac0ea13013b058729d07500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000214e8348c4f0000000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b250000000000000000000000000000000000000000000000000000000000000100000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a879420000000000000000000000000000000000000000000000000000000000000012506f6c796d657220416461707465722076320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000a4b100000000000000000000000000000000000000000000000000000000000021050000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000e708000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000013e310000000000000000000000000000000000000000000000000000000000001388000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000138de00000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000d0a0000000000000000000000000000000000000000000000000000000000000097000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000003e7

-----Decoded View---------------
Arg [0] : _prover (address): 0x95ccEAE71605c5d97A0AC0EA13013b058729d075
Arg [1] : name (string): Polymer Adapter v2
Arg [2] : minimumGas (uint256): 150000000000000000
Arg [3] : treasury (address): 0x359f01614EED04Dbe2b9A3F6d45835cB1b200B25
Arg [4] : chainIds (uint256[]): 42161,8453,1,59144,10,81457,5000,146,80094,130,3338,151,288,999
Arg [5] : owner (address): 0xb30DC8adA8a9a704cC803B60F98EC92084a87942

-----Encoded View---------------
23 Constructor Arguments found :
Arg [0] : 00000000000000000000000095cceae71605c5d97a0ac0ea13013b058729d075
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000214e8348c4f0000
Arg [3] : 000000000000000000000000359f01614eed04dbe2b9a3f6d45835cb1b200b25
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [5] : 000000000000000000000000b30dc8ada8a9a704cc803b60f98ec92084a87942
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [7] : 506f6c796d657220416461707465722076320000000000000000000000000000
Arg [8] : 000000000000000000000000000000000000000000000000000000000000000e
Arg [9] : 000000000000000000000000000000000000000000000000000000000000a4b1
Arg [10] : 0000000000000000000000000000000000000000000000000000000000002105
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [12] : 000000000000000000000000000000000000000000000000000000000000e708
Arg [13] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [14] : 0000000000000000000000000000000000000000000000000000000000013e31
Arg [15] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000092
Arg [17] : 00000000000000000000000000000000000000000000000000000000000138de
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000082
Arg [19] : 0000000000000000000000000000000000000000000000000000000000000d0a
Arg [20] : 0000000000000000000000000000000000000000000000000000000000000097
Arg [21] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [22] : 00000000000000000000000000000000000000000000000000000000000003e7


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

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.