ETH Price: $2,511.49 (-0.24%)

Contract

0xc025cF6eF842EF60c67A5dD87e2407006f317d4f
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040177684252023-07-25 6:47:59465 days ago1690267679IN
 Create: DavosBridge
0 ETH0.0448295819.00687225

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DavosBridge

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 18 : DavosBridge.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.16;
pragma abicoder v2;

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";

import "../interfaces/IDavosBridge.sol";

import "../libraries/EthereumVerifier.sol";
import "../libraries/ProofParser.sol";
import "../libraries/Utils.sol";

contract DavosBridge is IDavosBridge, OwnableUpgradeable, PausableUpgradeable, ReentrancyGuardUpgradeable {

    // --- Vars ---
    uint256 private _globalNonce;
    address private _consensusAddress;
    Metadata private _nativeTokenMetadata;

    mapping(bytes32 => bool) private _usedProofs;
    mapping(uint256 => address) private _bridgeAddressByChainId;
    mapping(bytes32 => address) private _warpDestinations; // KECCAK256(fromToken,fromChain,_bridgeAddressByChainId(toChain), toChain) => destinationToken

    /// @custom:oz-upgrades-unsafe-allow constructor
    // --- Constructor ---
    constructor() { _disableInitializers(); }

    // --- Init ---
    function initialize(address consensusAddress, string memory nativeTokenSymbol, string memory nativeTokenName) external initializer {

        __Ownable_init();
        __Pausable_init();
        __ReentrancyGuard_init();

        _consensusAddress = consensusAddress;
        _nativeTokenMetadata = Metadata(
            Utils.stringToBytes32(nativeTokenSymbol),
            Utils.stringToBytes32(nativeTokenName),
            block.chainid,
            address(bytes20(keccak256(abi.encodePacked("DavosBridge", nativeTokenSymbol))))     
        );
    }

    // --- User ---
    function depositToken(address fromToken, uint256 toChain, address toAddress, uint256 amount) external override nonReentrant whenNotPaused {

        if (warpDestination(fromToken, toChain) != address(0)) {
            _depositWarped(fromToken, toChain, toAddress, amount);
        } else revert("DavosBridge/warp-destination-unknown");
    }
    /**
     * @dev Tokens on source and destination chains are linked with independent supplies.
     * Burns tokens on source chain (to later mint on destination chain).
     * @param fromToken one of many warp-able token on source chain.
     * @param toChain one of many destination chain ID.
     * @param toAddress claimer of 'totalAmount' on destination chain.
     * @param totalAmount amout of tokens to be warped.
     */
    function _depositWarped(address fromToken, uint256 toChain, address toAddress, uint256 totalAmount) internal {

        require(_bridgeAddressByChainId[toChain] != address(0), "DavosBridge/non-existing-bridge");
        address fromAddress = address(msg.sender);
        
        uint256 balanceBefore = IERC20Upgradeable(fromToken).balanceOf(fromAddress);
        IERC20Mintable(fromToken).burn(fromAddress, totalAmount); 
        uint256 balanceAfter = IERC20Upgradeable(fromToken).balanceOf(fromAddress);
        require(balanceAfter + totalAmount == balanceBefore, "DavosBridge/incorrect-transfer-amount");

        /* fromToken and toToken are independent, originChain and originAddress are invalid */
        Metadata memory metaData = Metadata(
            Utils.stringToBytes32(IERC20Extra(fromToken).symbol()),
            Utils.stringToBytes32(IERC20Extra(fromToken).name()),
            0,
            address(0)
        );

       _globalNonce++;

        emit DepositWarped(toChain, fromAddress, toAddress, fromToken, warpDestination(fromToken, toChain), _amountErc20Token(fromToken, totalAmount), _globalNonce, metaData);
    }
    function _amountErc20Token(address fromToken, uint256 totalAmount) internal returns (uint256) {

        /* scale amount to 18 decimals */
        require(IERC20Extra(fromToken).decimals() <= 18, "DavosBridge/decimals-overflow");
        totalAmount *= (10**(18 - IERC20Extra(fromToken).decimals()));
        return totalAmount;
    }
    function withdraw(bytes calldata, /* encodedProof */ bytes calldata rawReceipt, bytes memory proofSignature) external override nonReentrant whenNotPaused {

        uint256 proofOffset;
        uint256 receiptOffset;
        assembly {
            proofOffset := add(0x4, calldataload(4))
            receiptOffset := add(0x4, calldataload(36))
        }
        /* we must parse and verify that tx and receipt matches */
        (EthereumVerifier.State memory state, EthereumVerifier.PegInType pegInType) = EthereumVerifier.parseTransactionReceipt(receiptOffset);

        require(state.chainId == block.chainid, "DavosBridge/receipt-points-to-another-chain");

        ProofParser.Proof memory proof = ProofParser.parseProof(proofOffset);
        require(state.contractAddress != address(0), "DavosBridge/invalid-contractAddress");
        require(_bridgeAddressByChainId[proof.chainId] == state.contractAddress, "DavosBridge/event-from-unknown-bridge");

        state.receiptHash = keccak256(rawReceipt);
        proof.status = 0x01;
        proof.receiptHash = state.receiptHash;

        bytes32 proofHash;
        assembly {
            proofHash := keccak256(proof, 0x100)
        }

        // we can trust receipt only if proof is signed by consensus
        require(ECDSAUpgradeable.recover(proofHash, proofSignature) == _consensusAddress, "DavosBridge/bad-signature");

        // withdraw funds to recipient
        _withdraw(state, pegInType, proof, proofHash);
    }
    function _withdraw(EthereumVerifier.State memory state, EthereumVerifier.PegInType pegInType, ProofParser.Proof memory proof, bytes32 payload) internal {

        require(!_usedProofs[payload], "DavosBridge/used-proof");
        _usedProofs[payload] = true;
        if (pegInType == EthereumVerifier.PegInType.Warp) {
            _withdrawWarped(state, proof);
        } else revert("DavosBridge/invalid-type");
    }
    function _withdrawWarped(EthereumVerifier.State memory state, ProofParser.Proof memory proof) internal {

        require(state.fromToken != address(0), "DavosBridge/invalid-fromToken");
        require(warpDestination(state.toToken, proof.chainId) == state.fromToken, "DavosBridge/bridge-from-unknown-destination");

        uint8 decimals = IERC20MetadataUpgradeable(state.toToken).decimals();
        require(decimals <= 18, "DavosBridge/decimals-overflow");

        uint256 scaledAmount = state.totalAmount / (10**(18 - decimals));
        IERC20Mintable(state.toToken).mint(state.toAddress, scaledAmount);

        emit WithdrawMinted(state.receiptHash, state.fromAddress, state.toAddress, state.fromToken, state.toToken, state.totalAmount);
    }

    // --- Admin ---
    function pause() public onlyOwner {

        _pause();
    }
    function unpause() public onlyOwner {

        _unpause();
    }
    function addBridge(address bridge, uint256 toChain) public onlyOwner {

        require(_bridgeAddressByChainId[toChain] == address(0x00), "DavosBridge/already-allowed");
        require(toChain > 0, "DavosBridge/invalid-chain");
        _bridgeAddressByChainId[toChain] = bridge;

        emit BridgeAdded(bridge, toChain);
    }
    function removeBridge(uint256 toChain) public onlyOwner {

        require(_bridgeAddressByChainId[toChain] != address(0x00), "already-removed");
        require(toChain > 0, "DavosBridge/invalid-chain");
        address bridge = _bridgeAddressByChainId[toChain];
        delete _bridgeAddressByChainId[toChain];

        emit BridgeRemoved(bridge, toChain);
    }
    function addWarpDestination(address fromToken, uint256 toChain, address toToken) external onlyOwner {

        require(_bridgeAddressByChainId[toChain] != address(0), "DavosBridge/bad-chain");
        bytes32 direction = keccak256(abi.encodePacked(fromToken, block.chainid, _bridgeAddressByChainId[toChain], toChain));
        require(_warpDestinations[direction] == address(0), "DavosBridge/known-destination");
        _warpDestinations[direction] = toToken;

        emit WarpDestinationAdded(fromToken, toChain, toToken);
    }
    function removeWarpDestination(address fromToken, uint256 toChain, address toToken) external onlyOwner {

        require(_bridgeAddressByChainId[toChain] != address(0), "DavosBridge/bad-chain");
        bytes32 direction = keccak256(abi.encodePacked(fromToken, block.chainid, _bridgeAddressByChainId[toChain], toChain));
        require(_warpDestinations[direction] != address(0), "DavosBridge/unknown-destination");
        delete _warpDestinations[direction];

        emit WarpDestinationRemoved(fromToken, toChain, toToken);
    }
    function changeConsensus(address consensus) public onlyOwner {

        require(consensus != address(0x0), "DavosBridge/invalid-address");
        _consensusAddress = consensus;

        emit ConsensusChanged(_consensusAddress);
    }
    function changeMetadata(address token, bytes32 name, bytes32 symbol) external onlyOwner {
        
        IERC20MetadataChangeable(token).changeName(name);
        IERC20MetadataChangeable(token).changeSymbol(symbol);
    }

    // --- Views ---
    function warpDestination(address fromToken, uint256 toChain) public view returns(address) {

        return _warpDestinations[keccak256(abi.encodePacked(fromToken, block.chainid, _bridgeAddressByChainId[toChain], toChain))];
    }
}

File 2 of 18 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 3 of 18 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

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

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

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

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

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

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 4 of 18 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 PausableUpgradeable is Initializable, ContextUpgradeable {
    /**
     * @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.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _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());
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

File 5 of 18 : ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

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

/**
 * @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 ReentrancyGuardUpgradeable is Initializable {
    // 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;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _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 This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}

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

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";

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

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

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

File 7 of 18 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 8 of 18 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

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

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}

File 10 of 18 : ECDSAUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../StringsUpgradeable.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSAUpgradeable {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 11 of 18 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    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) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 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 10, 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 * 8) < value ? 1 : 0);
        }
    }
}

File 12 of 18 : StringsUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/MathUpgradeable.sol";

/**
 * @dev String operations.
 */
library StringsUpgradeable {
    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 = MathUpgradeable.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 `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, MathUpgradeable.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);
    }
}

File 13 of 18 : IDavosBridge.sol
// // SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.16;

import "./IERC20.sol";

interface IDavosBridge {

    // --- Structs ---
    struct Metadata {
        bytes32 symbol;
        bytes32 name;
        uint256 originChain;
        address originAddress;
    }

    // --- Events ---
    event BridgeAdded(address bridge, uint256 toChain);
    event BridgeRemoved(address bridge, uint256 toChain);
    event WarpDestinationAdded(address indexed fromToken, uint256 indexed toChain, address indexed toToken);
    event WarpDestinationRemoved(address indexed fromToken, uint256 indexed toChain, address indexed toToken);
    event ConsensusChanged(address consensusAddress);
    event DepositWarped(uint256 chainId, address indexed fromAddress, address indexed toAddress, address fromToken, address toToken, uint256 totalAmount, uint256 nonce, Metadata metadata);
    event WithdrawMinted(bytes32 receiptHash, address indexed fromAddress, address indexed toAddress, address fromToken, address toToken, uint256 totalAmount);

    // --- Functions ---
    function depositToken(address fromToken, uint256 toChain, address toAddress, uint256 amount) external;
    function withdraw(bytes calldata encodedProof, bytes calldata rawReceipt, bytes memory receiptRootSignature) external;
}

File 14 of 18 : IERC20.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.16;

interface IERC20Mintable {
    function mint(address account, uint256 amount) external;

    function burn(address account, uint256 amount) external;

    // use for charge bridge commission before burn
    function chargeFrom(address sender, address recipient, uint256 amount) external returns (bool);
}

interface IERC20Pegged {
    function getOrigin() external view returns (uint256, address);
}

interface IERC20Extra {
    function name() external returns (string memory);

    function decimals() external returns (uint8);

    function symbol() external returns (string memory);
}

interface IERC20MetadataChangeable {
    event NameChanged(string prevValue, string newValue);

    event SymbolChanged(string prevValue, string newValue);

    function changeName(bytes32) external;

    function changeSymbol(bytes32) external;
}

File 15 of 18 : CallDataRLPReader.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.16;

library CallDataRLPReader {
    uint8 constant STRING_SHORT_START = 0x80;
    uint8 constant STRING_LONG_START = 0xb8;
    uint8 constant LIST_SHORT_START = 0xc0;
    uint8 constant LIST_LONG_START = 0xf8;
    uint8 constant WORD_SIZE = 32;

    function beginIteration(uint256 listOffset)
        internal
        pure
        returns (uint256 iter)
    {
        return listOffset + _payloadOffset(listOffset);
    }

    function next(uint256 iter) internal pure returns (uint256 nextIter) {
        return iter + itemLength(iter);
    }

    function payloadLen(uint256 ptr, uint256 len)
        internal
        pure
        returns (uint256)
    {
        return len - _payloadOffset(ptr);
    }

    function toAddress(uint256 ptr) internal pure returns (address) {
        return address(uint160(toUint(ptr, 21)));
    }

    function toUint(uint256 ptr, uint256 len) internal pure returns (uint256) {
        require(len > 0 && len <= 33);
        uint256 offset = _payloadOffset(ptr);
        uint256 numLen = len - offset;

        uint256 result;
        assembly {
            result := calldataload(add(ptr, offset))
            // cut off redundant bytes
            result := shr(mul(8, sub(32, numLen)), result)
        }
        return result;
    }

    function toUintStrict(uint256 ptr) internal pure returns (uint256) {
        // one byte prefix
        uint256 result;
        assembly {
            result := calldataload(add(ptr, 1))
        }
        return result;
    }

    function rawDataPtr(uint256 ptr) internal pure returns (uint256) {
        return ptr + _payloadOffset(ptr);
    }

    // @return entire rlp item byte length
    function itemLength(uint256 callDataPtr) internal pure returns (uint256) {
        uint256 itemLen;
        uint256 byte0;
        assembly {
            byte0 := byte(0, calldataload(callDataPtr))
        }

        if (byte0 < STRING_SHORT_START) itemLen = 1;
        else if (byte0 < STRING_LONG_START)
            itemLen = byte0 - STRING_SHORT_START + 1;
        else if (byte0 < LIST_SHORT_START) {
            assembly {
                let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is
                callDataPtr := add(callDataPtr, 1) // skip over the first byte

                /* 32 byte word size */
                let dataLen := shr(
                    mul(8, sub(32, byteLen)),
                    calldataload(callDataPtr)
                )
                itemLen := add(dataLen, add(byteLen, 1))
            }
        } else if (byte0 < LIST_LONG_START) {
            itemLen = byte0 - LIST_SHORT_START + 1;
        } else {
            assembly {
                let byteLen := sub(byte0, 0xf7)
                callDataPtr := add(callDataPtr, 1)

                let dataLen := shr(
                    mul(8, sub(32, byteLen)),
                    calldataload(callDataPtr)
                )
                itemLen := add(dataLen, add(byteLen, 1))
            }
        }

        return itemLen;
    }

    // @return number of bytes until the data
    function _payloadOffset(uint256 callDataPtr)
        private
        pure
        returns (uint256)
    {
        uint256 byte0;
        assembly {
            byte0 := byte(0, calldataload(callDataPtr))
        }

        if (byte0 < STRING_SHORT_START) return 0;
        else if (
            byte0 < STRING_LONG_START ||
            (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START)
        ) return 1;
        else if (byte0 < LIST_SHORT_START)
            return byte0 - (STRING_LONG_START - 1) + 1;
        else return byte0 - (LIST_LONG_START - 1) + 1;
    }
}

File 16 of 18 : EthereumVerifier.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.16;

import "./CallDataRLPReader.sol";
import "./Utils.sol";
import "../interfaces/IDavosBridge.sol";

library EthereumVerifier {
    
    bytes32 constant TOPIC_PEG_IN_WARPED = keccak256("DepositWarped(uint256,address,address,address,address,uint256,uint256,(bytes32,bytes32,uint256,address))");

    enum PegInType {
        None,
        Warp
    }

    struct State {
        bytes32 receiptHash;
        address contractAddress;
        uint256 chainId;
        address fromAddress;
        address toAddress;
        address fromToken;
        address toToken;
        uint256 totalAmount;
        uint256 nonce;
        // metadata fields (we can't use Metadata struct here because of Solidity struct memory layout)
        bytes32 symbol;
        bytes32 name;
        uint256 originChain;
        address originToken;
    }

    function getMetadata(State memory state)
        internal
        pure
        returns (IDavosBridge.Metadata memory)
    {
        IDavosBridge.Metadata memory metadata;
        assembly {
            metadata := add(state, 0x120)
        }
        return metadata;
    }

    function parseTransactionReceipt(uint256 receiptOffset)
        internal
        pure
        returns (State memory state, PegInType pegInType)
    {
        /* parse peg-in data from logs */
        uint256 iter = CallDataRLPReader.beginIteration(receiptOffset + 0x20);
        {
            /* postStateOrStatus - we must ensure that tx is not reverted */
            uint256 statusOffset = iter;
            iter = CallDataRLPReader.next(iter);
            require(
                CallDataRLPReader.payloadLen(
                    statusOffset,
                    iter - statusOffset
                ) == 1,
                "EthereumVerifier: tx is reverted"
            );
        }
        /* skip cumulativeGasUsed */
        iter = CallDataRLPReader.next(iter);
        /* logs - we need to find our logs */
        uint256 logs = iter;
        iter = CallDataRLPReader.next(iter);
        uint256 logsIter = CallDataRLPReader.beginIteration(logs);
        for (; logsIter < iter; ) {
            uint256 log = logsIter;
            logsIter = CallDataRLPReader.next(logsIter);
            /* make sure there is only one peg-in event in logs */
            PegInType logType = _decodeReceiptLogs(state, log);
            if (logType != PegInType.None) {
                require(
                    pegInType == PegInType.None,
                    "EthereumVerifier: multiple logs"
                );
                pegInType = logType;
            }
        }
        /* don't allow to process if peg-in type is unknown */
        require(pegInType != PegInType.None, "EthereumVerifier: missing logs");
        return (state, pegInType);
    }

    function _decodeReceiptLogs(State memory state, uint256 log)
        internal
        pure
        returns (PegInType pegInType)
    {
        uint256 logIter = CallDataRLPReader.beginIteration(log);
        address contractAddress;
        {
            /* parse smart contract address */
            uint256 addressOffset = logIter;
            logIter = CallDataRLPReader.next(logIter);
            contractAddress = CallDataRLPReader.toAddress(addressOffset);
        }
        /* topics */
        bytes32 mainTopic;
        address fromAddress;
        address toAddress;
        {
            uint256 topicsIter = logIter;
            logIter = CallDataRLPReader.next(logIter);
            // Must be 3 topics RLP encoded: event signature, fromAddress, toAddress
            // Each topic RLP encoded is 33 bytes (0xa0[32 bytes data])
            // Total payload: 99 bytes. Since it's list with total size bigger than 55 bytes we need 2 bytes prefix (0xf863)
            // So total size of RLP encoded topics array must be 101
            if (CallDataRLPReader.itemLength(topicsIter) != 101) {
                return PegInType.None;
            }
            topicsIter = CallDataRLPReader.beginIteration(topicsIter);
            mainTopic = bytes32(CallDataRLPReader.toUintStrict(topicsIter));
            topicsIter = CallDataRLPReader.next(topicsIter);
            fromAddress = address(
                bytes20(uint160(CallDataRLPReader.toUintStrict(topicsIter)))
            );
            topicsIter = CallDataRLPReader.next(topicsIter);
            toAddress = address(
                bytes20(uint160(CallDataRLPReader.toUintStrict(topicsIter)))
            );
            topicsIter = CallDataRLPReader.next(topicsIter);
            require(topicsIter == logIter); // safety check that iteration is finished
        }

        uint256 ptr = CallDataRLPReader.rawDataPtr(logIter);
        logIter = CallDataRLPReader.next(logIter);
        uint256 len = logIter - ptr;
        {
            // parse logs based on topic type and check that event data has correct length
            uint256 expectedLen;
            if (mainTopic == TOPIC_PEG_IN_WARPED) {
                expectedLen = 0x120;
                pegInType = PegInType.Warp;
            } else {
                return PegInType.None;
            }
            if (len != expectedLen) {
                return PegInType.None;
            }
        }
        {
            // read chain id separately and verify that contract that emitted event is relevant
            uint256 chainId;
            assembly {
                chainId := calldataload(ptr)
            }
            //  if (chainId != Utils.currentChain()) return PegInType.None;
            // All checks are passed after this point, no errors allowed and we can modify state
            state.chainId = chainId;
            ptr += 0x20;
            len -= 0x20;
        }

        {
            uint256 structOffset;
            assembly {
                // skip 5 fields: receiptHash, contractAddress, chainId, fromAddress, toAddress
                structOffset := add(state, 0xa0)
                calldatacopy(structOffset, ptr, len)
            }
        }
        state.contractAddress = contractAddress;
        state.fromAddress = fromAddress;
        state.toAddress = toAddress;
        return pegInType;
    }
}

File 17 of 18 : ProofParser.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.6;

import "./CallDataRLPReader.sol";
import "./Utils.sol";

library ProofParser {
    // Proof is message format signed by the protocol. It contains somewhat redundant information, so only part
    // of the proof could be passed into the contract and other part can be inferred from transaction receipt
    struct Proof {
        uint256 chainId;
        uint256 status;
        bytes32 transactionHash;
        uint256 blockNumber;
        bytes32 blockHash;
        uint256 transactionIndex;
        bytes32 receiptHash;
        uint256 transferAmount;
    }

    function parseProof(uint256 proofOffset)
        internal
        pure
        returns (Proof memory)
    {
        Proof memory proof;
        uint256 dataOffset = proofOffset + 0x20;
        assembly {
            calldatacopy(proof, dataOffset, 0x20) // 1 field (chainId)
            dataOffset := add(dataOffset, 0x40)
            calldatacopy(add(proof, 0x40), dataOffset, 0x80) // 4 fields * 0x20 = 0x80
            dataOffset := add(dataOffset, 0xa0)
            calldatacopy(add(proof, 0xe0), dataOffset, 0x20) // transferAmount
        }
        return proof;
    }
}

File 18 of 18 : Utils.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.16;

library Utils {
    function currentChain() internal view returns (uint256) {
        uint256 chain;
        assembly {
            chain := chainid()
        }
        return chain;
    }

    function stringToBytes32(string memory source)
        internal
        pure
        returns (bytes32 result)
    {
        bytes memory tempEmptyStringTest = bytes(source);
        if (tempEmptyStringTest.length == 0) {
            return 0x0;
        }
        assembly {
            result := mload(add(source, 32))
        }
    }

    function saturatingMultiply(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        unchecked {
            if (a == 0) return 0;
            uint256 c = a * b;
            if (c / a != b) return type(uint256).max;
            return c;
        }
    }

    function saturatingAdd(uint256 a, uint256 b)
        internal
        pure
        returns (uint256)
    {
        unchecked {
            uint256 c = a + b;
            if (c < a) return type(uint256).max;
            return c;
        }
    }

    // Preconditions:
    //  1. a may be arbitrary (up to 2 ** 256 - 1)
    //  2. b * c < 2 ** 256
    // Returned value: min(floor((a * b) / c), 2 ** 256 - 1)
    function multiplyAndDivideFloor(
        uint256 a,
        uint256 b,
        uint256 c
    ) internal pure returns (uint256) {
        return
            saturatingAdd(
                saturatingMultiply(a / c, b),
                ((a % c) * b) / c // can't fail because of assumption 2.
            );
    }

    // Preconditions:
    //  1. a may be arbitrary (up to 2 ** 256 - 1)
    //  2. b * c < 2 ** 256
    // Returned value: min(ceil((a * b) / c), 2 ** 256 - 1)
    function multiplyAndDivideCeil(
        uint256 a,
        uint256 b,
        uint256 c
    ) internal pure returns (uint256) {
        return
            saturatingAdd(
                saturatingMultiply(a / c, b),
                ((a % c) * b + (c - 1)) / c // can't fail because of assumption 2.
            );
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bridge","type":"address"},{"indexed":false,"internalType":"uint256","name":"toChain","type":"uint256"}],"name":"BridgeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bridge","type":"address"},{"indexed":false,"internalType":"uint256","name":"toChain","type":"uint256"}],"name":"BridgeRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"consensusAddress","type":"address"}],"name":"ConsensusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"bytes32","name":"symbol","type":"bytes32"},{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"uint256","name":"originChain","type":"uint256"},{"internalType":"address","name":"originAddress","type":"address"}],"indexed":false,"internalType":"struct IDavosBridge.Metadata","name":"metadata","type":"tuple"}],"name":"DepositWarped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"toChain","type":"uint256"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"}],"name":"WarpDestinationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"uint256","name":"toChain","type":"uint256"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"}],"name":"WarpDestinationRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"receiptHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"address","name":"fromToken","type":"address"},{"indexed":false,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"}],"name":"WithdrawMinted","type":"event"},{"inputs":[{"internalType":"address","name":"bridge","type":"address"},{"internalType":"uint256","name":"toChain","type":"uint256"}],"name":"addBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"toChain","type":"uint256"},{"internalType":"address","name":"toToken","type":"address"}],"name":"addWarpDestination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"consensus","type":"address"}],"name":"changeConsensus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"bytes32","name":"name","type":"bytes32"},{"internalType":"bytes32","name":"symbol","type":"bytes32"}],"name":"changeMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"toChain","type":"uint256"},{"internalType":"address","name":"toAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"consensusAddress","type":"address"},{"internalType":"string","name":"nativeTokenSymbol","type":"string"},{"internalType":"string","name":"nativeTokenName","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"toChain","type":"uint256"}],"name":"removeBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"toChain","type":"uint256"},{"internalType":"address","name":"toToken","type":"address"}],"name":"removeWarpDestination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"uint256","name":"toChain","type":"uint256"}],"name":"warpDestination","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"rawReceipt","type":"bytes"},{"internalType":"bytes","name":"proofSignature","type":"bytes"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61293680620000f46000396000f3fe608060405234801561001057600080fd5b50600436106100e05760003560e01c80638da5cb5b116100875780638da5cb5b1461016657806390657147146101805780639805f11a14610193578063c5ea6768146101a6578063c7725bad146101b9578063d0f48715146101cc578063d2f125b2146101df578063f2fde38b146101f257600080fd5b80632f0de139146100e55780633f4ba83a146100fa578063570c20b7146101025780635ac02ed0146101155780635c975abb146101285780636701ccb514610143578063715018a6146101565780638456cb591461015e575b600080fd5b6100f86100f33660046121a8565b610205565b005b6100f86102bf565b6100f86101103660046121c3565b6102d1565b6100f86101233660046121ed565b6103c3565b60655460ff1660405190151581526020015b60405180910390f35b6100f8610151366004612206565b61049e565b6100f861053d565b6100f861054f565b6033546001600160a01b03165b60405161013a919061224a565b6100f861018e36600461232b565b61055f565b6100f86101a136600461239f565b61072f565b6101736101b43660046121c3565b6107f0565b6100f86101c73660046123d2565b61085b565b6100f86101da366004612450565b61099e565b6100f86101ed3660046123d2565b610bdd565b6100f86102003660046121a8565b610d27565b61020d610da0565b6001600160a01b0381166102685760405162461bcd60e51b815260206004820152601b60248201527f4461766f734272696467652f696e76616c69642d61646472657373000000000060448201526064015b60405180910390fd5b60ca80546001600160a01b0319166001600160a01b0383169081179091556040517f1e2dea1ea1c691deaacf3226024b51e2b907bb9db3a24135738faf96a19b9ed0916102b49161224a565b60405180910390a150565b6102c7610da0565b6102cf610dfa565b565b6102d9610da0565b600081815260d060205260409020546001600160a01b03161561033e5760405162461bcd60e51b815260206004820152601b60248201527f4461766f734272696467652f616c72656164792d616c6c6f7765640000000000604482015260640161025f565b6000811161035e5760405162461bcd60e51b815260040161025f906124f8565b600081815260d060205260409081902080546001600160a01b0319166001600160a01b038516179055517f10916f5c971b65b1a3f05d1a63bfc558ca4d659670f408b6de05007215f1812a906103b7908490849061252b565b60405180910390a15050565b6103cb610da0565b600081815260d060205260409020546001600160a01b03166104215760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b5c995b5bdd9959608a1b604482015260640161025f565b600081116104415760405162461bcd60e51b815260040161025f906124f8565b600081815260d060205260409081902080546001600160a01b0319811690915590516001600160a01b03909116907ffc5b6fb2b8ba31620717843fd7a36a4ad996612ff9f3ece7cba2900efb43bc2b906103b7908390859061252b565b6104a6610e46565b6104ae610e9f565b60006104ba85856107f0565b6001600160a01b0316146104d9576104d484848484610ee5565b61052d565b60405162461bcd60e51b8152602060048201526024808201527f4461766f734272696467652f776172702d64657374696e6174696f6e2d756e6b6044820152633737bbb760e11b606482015260840161025f565b6105376001609755565b50505050565b610545610da0565b6102cf60006112a5565b610557610da0565b6102cf6112f7565b600054610100900460ff161580801561057f5750600054600160ff909116105b806105995750303b158015610599575060005460ff166001145b6105fc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161025f565b6000805460ff19166001179055801561061f576000805461ff0019166101001790555b610627611334565b61062f611363565b610637611392565b60ca80546001600160a01b0319166001600160a01b038616179055604080516080810190915280610667856113c1565b8152602001610675846113c1565b8152602001468152602001846040516020016106919190612568565b60408051808303601f190181529181528151602092830120606090811c909352835160cb559083015160cc5582015160cd55015160ce80546001600160a01b0319166001600160a01b039092169190911790558015610537576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610737610da0565b60405163898855ed60e01b8152600481018390526001600160a01b0384169063898855ed90602401600060405180830381600087803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b5050604051630d6c7ef360e11b8152600481018490526001600160a01b0386169250631ad8fde69150602401600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b50505050505050565b600081815260d06020908152604080832054905160d192849261082392889246926001600160a01b03169189910161259b565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b610863610da0565b600082815260d060205260409020546001600160a01b03166108975760405162461bcd60e51b815260040161025f906125d4565b600082815260d0602090815260408083205490516108c792879246926001600160a01b039091169188910161259b565b60408051601f198184030181529181528151602092830120600081815260d19093529120549091506001600160a01b03166109445760405162461bcd60e51b815260206004820152601f60248201527f4461766f734272696467652f756e6b6e6f776e2d64657374696e6174696f6e00604482015260640161025f565b600081815260d1602052604080822080546001600160a01b0319169055516001600160a01b03848116928692918816917fbbcefea7388a2fce55f6f7bc8b8fb140e4a90100232f853b2892432748d185b89190a450505050565b6109a6610e46565b6109ae610e9f565b60048035810190602435016000806109c5836113e0565b9150915046826040015114610a305760405162461bcd60e51b815260206004820152602b60248201527f4461766f734272696467652f726563656970742d706f696e74732d746f2d616e60448201526a37ba3432b916b1b430b4b760a91b606482015260840161025f565b6000610a3b85611605565b60208401519091506001600160a01b0316610aa45760405162461bcd60e51b815260206004820152602360248201527f4461766f734272696467652f696e76616c69642d636f6e74726163744164647260448201526265737360e81b606482015260840161025f565b6020808401518251600090815260d09092526040909120546001600160a01b03908116911614610b245760405162461bcd60e51b815260206004820152602560248201527f4461766f734272696467652f6576656e742d66726f6d2d756e6b6e6f776e2d62604482015264726964676560d81b606482015260840161025f565b8787604051610b34929190612603565b604051908190039020835260016020820152825160c0820152610100812060ca546001600160a01b0316610b688289611649565b6001600160a01b031614610bba5760405162461bcd60e51b81526020600482015260196024820152784461766f734272696467652f6261642d7369676e617475726560381b604482015260640161025f565b610bc68484848461166d565b505050505050610bd66001609755565b5050505050565b610be5610da0565b600082815260d060205260409020546001600160a01b0316610c195760405162461bcd60e51b815260040161025f906125d4565b600082815260d060209081526040808320549051610c4992879246926001600160a01b039091169188910161259b565b60408051601f198184030181529181528151602092830120600081815260d19093529120549091506001600160a01b031615610cc75760405162461bcd60e51b815260206004820152601d60248201527f4461766f734272696467652f6b6e6f776e2d64657374696e6174696f6e000000604482015260640161025f565b600081815260d1602052604080822080546001600160a01b0319166001600160a01b03868116918217909255915191928692918816917fe28a125d78f695ba47a84c50686b72e8157091f96188b62d21945f155ec72d479190a450505050565b610d2f610da0565b6001600160a01b038116610d945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161025f565b610d9d816112a5565b50565b6033546001600160a01b031633146102cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161025f565b610e0261174a565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610e3c919061224a565b60405180910390a1565b600260975403610e985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161025f565b6002609755565b60655460ff16156102cf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161025f565b600083815260d060205260409020546001600160a01b0316610f495760405162461bcd60e51b815260206004820152601f60248201527f4461766f734272696467652f6e6f6e2d6578697374696e672d62726964676500604482015260640161025f565b6040516370a0823160e01b815233906000906001600160a01b038716906370a0823190610f7a90859060040161224a565b602060405180830381865afa158015610f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbb9190612613565b604051632770a7eb60e21b81529091506001600160a01b03871690639dc29fac90610fec908590879060040161252b565b600060405180830381600087803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b03891691506370a082319061104d90869060040161224a565b602060405180830381865afa15801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190612613565b90508161109b8583612642565b146110f65760405162461bcd60e51b815260206004820152602560248201527f4461766f734272696467652f696e636f72726563742d7472616e736665722d616044820152641b5bdd5b9d60da1b606482015260840161025f565b600060405180608001604052806111738a6001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af1158015611146573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261116e9190810190612655565b6113c1565b81526020016111bb8a6001600160a01b03166306fdde036040518163ffffffff1660e01b81526004016000604051808303816000875af1158015611146573d6000803e3d6000fd5b8152600060208201819052604090910181905260c98054929350906111df836126cc565b9190505550856001600160a01b0316846001600160a01b03167fbb91bc033add952080918570fb6f133f59b480190b2e57e131fb76a6cc5a605b898b6112258d8d6107f0565b61122f8e8c611793565b60c954604080519586526001600160a01b03948516602080880191909152938516868201526060808701939093526080860191909152885160a08601529188015160c08501529087015160e0840152860151166101008201526101200160405180910390a35050505050505050565b6001609755565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6112ff610e9f565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e2f3390565b600054610100900460ff1661135b5760405162461bcd60e51b815260040161025f906126e5565b6102cf6118a7565b600054610100900460ff1661138a5760405162461bcd60e51b815260040161025f906126e5565b6102cf6118d7565b600054610100900460ff166113b95760405162461bcd60e51b815260040161025f906126e5565b6102cf61190a565b8051600090829082036113d75750600092915050565b50506020015190565b604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081019190915260008061145f61145a856020612642565b611931565b90508061146b81611946565b91506114808161147b8185612730565b611951565b6001146114cf5760405162461bcd60e51b815260206004820181905260248201527f457468657265756d56657269666965723a207478206973207265766572746564604482015260640161025f565b506114d981611946565b9050806114e581611946565b915060006114f282611931565b90505b8281101561159c578061150781611946565b915060006115158783611966565b9050600081600181111561152b5761152b612743565b1461159557600086600181111561154457611544612743565b146115915760405162461bcd60e51b815260206004820152601f60248201527f457468657265756d56657269666965723a206d756c7469706c65206c6f677300604482015260640161025f565b8095505b50506114f5565b60008460018111156115b0576115b0612743565b036115fd5760405162461bcd60e51b815260206004820152601e60248201527f457468657265756d56657269666965723a206d697373696e67206c6f67730000604482015260640161025f565b505050915091565b61160d612148565b611615612148565b6000611622846020612642565b90506020818337604081019050608081604084013760a00160208160e08401375092915050565b60008060006116588585611afb565b9150915061166581611b40565b509392505050565b600081815260cf602052604090205460ff16156116c55760405162461bcd60e51b81526020600482015260166024820152752230bb37b9a13934b233b297bab9b2b216b83937b7b360511b604482015260640161025f565b600081815260cf60205260409020805460ff191660019081179091558360018111156116f3576116f3612743565b03611707576117028483611c85565b610537565b60405162461bcd60e51b81526020600482015260186024820152774461766f734272696467652f696e76616c69642d7479706560401b604482015260640161025f565b60655460ff166102cf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161025f565b60006012836001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af11580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fb9190612759565b60ff16111561181c5760405162461bcd60e51b815260040161025f9061277c565b826001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af115801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190612759565b61188b9060126127b3565b61189690600a6128b0565b6118a090836128bf565b9392505050565b600054610100900460ff166118ce5760405162461bcd60e51b815260040161025f906126e5565b6102cf336112a5565b600054610100900460ff166118fe5760405162461bcd60e51b815260040161025f906126e5565b6065805460ff19169055565b600054610100900460ff1661129e5760405162461bcd60e51b815260040161025f906126e5565b600061193c82611f17565b6108559083612642565b600061193c82611f91565b600061195c83611f17565b6118a09083612730565b60008061197283611931565b905060008161198081611946565b925061198b81612034565b91506000905080808461199d81611946565b95506119a881611f91565b6065146119be5760009650505050505050610855565b6119c781611931565b9050600181013593506119d981611946565b905060018101356001600160a01b031692506119f481611946565b905060018101356001600160a01b03169150611a0f81611946565b9050858114611a1d57600080fd5b506000611a2986611931565b9050611a3486611946565b95506000611a428288612730565b905060007fbb91bc033add952080918570fb6f133f59b480190b2e57e131fb76a6cc5a605b8603611a7a575060019750610120611a8b565b600098505050505050505050610855565b808214611aa357600098505050505050505050610855565b50813560408b01819052611ab8602084612642565b9250611ac5602083612730565b91505060a08a01818382375050506001600160a01b03938416602089015290831660608801529091166080860152505092915050565b6000808251604103611b315760208301516040840151606085015160001a611b2587828585612041565b94509450505050611b39565b506000905060025b9250929050565b6000816004811115611b5457611b54612743565b03611b5c5750565b6001816004811115611b7057611b70612743565b03611bb85760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161025f565b6002816004811115611bcc57611bcc612743565b03611c195760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161025f565b6003816004811115611c2d57611c2d612743565b03610d9d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161025f565b60a08201516001600160a01b0316611cdf5760405162461bcd60e51b815260206004820152601d60248201527f4461766f734272696467652f696e76616c69642d66726f6d546f6b656e000000604482015260640161025f565b8160a001516001600160a01b0316611cff8360c0015183600001516107f0565b6001600160a01b031614611d695760405162461bcd60e51b815260206004820152602b60248201527f4461766f734272696467652f6272696467652d66726f6d2d756e6b6e6f776e2d60448201526a3232b9ba34b730ba34b7b760a91b606482015260840161025f565b60008260c001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd19190612759565b905060128160ff161115611df75760405162461bcd60e51b815260040161025f9061277c565b6000611e048260126127b3565b611e0f90600a6128b0565b8460e00151611e1e91906128de565b90508360c001516001600160a01b03166340c10f198560800151836040518363ffffffff1660e01b8152600401611e5692919061252b565b600060405180830381600087803b158015611e7057600080fd5b505af1158015611e84573d6000803e3d6000fd5b5050505083608001516001600160a01b031684606001516001600160a01b03167f7ef13c4fefd7825b89456cad661f67d3969e8c54ff26aa038aa13d904b7b98b086600001518760a001518860c001518960e00151604051611f0994939291909384526001600160a01b03928316602085015291166040830152606082015260800190565b60405180910390a350505050565b60008135811a6080811015611f2f5750600092915050565b60b8811080611f4a575060c08110801590611f4a575060f881105b15611f585750600192915050565b60c0811015611f8557611f6d600160b86127b3565b611f7a9060ff1682612730565b6118a0906001612642565b611f6d600160f86127b3565b6000808235811a6080811015611faa576001915061202d565b60b8811015611fd057611fbe608082612730565b611fc9906001612642565b915061202d565b60c0811015611ffb576001939093019283356008602083900360b701021c810160b51901915061202d565b60f881101561200f57611fbe60c082612730565b6001939093019283356008602083900360f701021c810160f5190191505b5092915050565b60006108558260156120fb565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561206e57506000905060036120f2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156120c2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166120eb576000600192509250506120f2565b9150600090505b94509492505050565b6000808211801561210d575060218211155b61211657600080fd5b600061212184611f17565b9050600061212f8285612730565b94909101356020949094036008029390931c9392505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b80356001600160a01b03811681146121a357600080fd5b919050565b6000602082840312156121ba57600080fd5b6118a08261218c565b600080604083850312156121d657600080fd5b6121df8361218c565b946020939093013593505050565b6000602082840312156121ff57600080fd5b5035919050565b6000806000806080858703121561221c57600080fd5b6122258561218c565b93506020850135925061223a6040860161218c565b9396929550929360600135925050565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561229d5761229d61225e565b604052919050565b600067ffffffffffffffff8211156122bf576122bf61225e565b50601f01601f191660200190565b60006122e06122db846122a5565b612274565b90508281528383830111156122f457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261231c57600080fd5b6118a0838335602085016122cd565b60008060006060848603121561234057600080fd5b6123498461218c565b9250602084013567ffffffffffffffff8082111561236657600080fd5b6123728783880161230b565b9350604086013591508082111561238857600080fd5b506123958682870161230b565b9150509250925092565b6000806000606084860312156123b457600080fd5b6123bd8461218c565b95602085013595506040909401359392505050565b6000806000606084860312156123e757600080fd5b6123f08461218c565b9250602084013591506124056040850161218c565b90509250925092565b60008083601f84011261242057600080fd5b50813567ffffffffffffffff81111561243857600080fd5b602083019150836020828501011115611b3957600080fd5b60008060008060006060868803121561246857600080fd5b853567ffffffffffffffff8082111561248057600080fd5b61248c89838a0161240e565b909750955060208801359150808211156124a557600080fd5b6124b189838a0161240e565b909550935060408801359150808211156124ca57600080fd5b508601601f810188136124dc57600080fd5b6124eb888235602084016122cd565b9150509295509295909350565b6020808252601990820152782230bb37b9a13934b233b297b4b73b30b634b216b1b430b4b760391b604082015260600190565b6001600160a01b03929092168252602082015260400190565b60005b8381101561255f578181015183820152602001612547565b50506000910152565b6a4461766f7342726964676560a81b81526000825161258e81600b850160208701612544565b91909101600b0192915050565b6bffffffffffffffffffffffff19606095861b8116825260148201949094529190931b9091166034820152604881019190915260680190565b6020808252601590820152742230bb37b9a13934b233b297b130b216b1b430b4b760591b604082015260600190565b8183823760009101908152919050565b60006020828403121561262557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156108555761085561262c565b60006020828403121561266757600080fd5b815167ffffffffffffffff81111561267e57600080fd5b8201601f8101841361268f57600080fd5b805161269d6122db826122a5565b8181528560208385010111156126b257600080fd5b6126c3826020830160208601612544565b95945050505050565b6000600182016126de576126de61262c565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156108555761085561262c565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561276b57600080fd5b815160ff811681146118a057600080fd5b6020808252601d908201527f4461766f734272696467652f646563696d616c732d6f766572666c6f77000000604082015260600190565b60ff82811682821603908111156108555761085561262c565b600181815b808511156128075781600019048211156127ed576127ed61262c565b808516156127fa57918102915b93841c93908002906127d1565b509250929050565b60008261281e57506001610855565b8161282b57506000610855565b8160018114612841576002811461284b57612867565b6001915050610855565b60ff84111561285c5761285c61262c565b50506001821b610855565b5060208310610133831016604e8410600b841016171561288a575081810a610855565b61289483836127cc565b80600019048211156128a8576128a861262c565b029392505050565b60006118a060ff84168361280f565b60008160001904831182151516156128d9576128d961262c565b500290565b6000826128fb57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220cf2dd1524e07985223f7906470b19817746139da52f255889703ab24dd1aaf5564736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100e05760003560e01c80638da5cb5b116100875780638da5cb5b1461016657806390657147146101805780639805f11a14610193578063c5ea6768146101a6578063c7725bad146101b9578063d0f48715146101cc578063d2f125b2146101df578063f2fde38b146101f257600080fd5b80632f0de139146100e55780633f4ba83a146100fa578063570c20b7146101025780635ac02ed0146101155780635c975abb146101285780636701ccb514610143578063715018a6146101565780638456cb591461015e575b600080fd5b6100f86100f33660046121a8565b610205565b005b6100f86102bf565b6100f86101103660046121c3565b6102d1565b6100f86101233660046121ed565b6103c3565b60655460ff1660405190151581526020015b60405180910390f35b6100f8610151366004612206565b61049e565b6100f861053d565b6100f861054f565b6033546001600160a01b03165b60405161013a919061224a565b6100f861018e36600461232b565b61055f565b6100f86101a136600461239f565b61072f565b6101736101b43660046121c3565b6107f0565b6100f86101c73660046123d2565b61085b565b6100f86101da366004612450565b61099e565b6100f86101ed3660046123d2565b610bdd565b6100f86102003660046121a8565b610d27565b61020d610da0565b6001600160a01b0381166102685760405162461bcd60e51b815260206004820152601b60248201527f4461766f734272696467652f696e76616c69642d61646472657373000000000060448201526064015b60405180910390fd5b60ca80546001600160a01b0319166001600160a01b0383169081179091556040517f1e2dea1ea1c691deaacf3226024b51e2b907bb9db3a24135738faf96a19b9ed0916102b49161224a565b60405180910390a150565b6102c7610da0565b6102cf610dfa565b565b6102d9610da0565b600081815260d060205260409020546001600160a01b03161561033e5760405162461bcd60e51b815260206004820152601b60248201527f4461766f734272696467652f616c72656164792d616c6c6f7765640000000000604482015260640161025f565b6000811161035e5760405162461bcd60e51b815260040161025f906124f8565b600081815260d060205260409081902080546001600160a01b0319166001600160a01b038516179055517f10916f5c971b65b1a3f05d1a63bfc558ca4d659670f408b6de05007215f1812a906103b7908490849061252b565b60405180910390a15050565b6103cb610da0565b600081815260d060205260409020546001600160a01b03166104215760405162461bcd60e51b815260206004820152600f60248201526e185b1c9958591e4b5c995b5bdd9959608a1b604482015260640161025f565b600081116104415760405162461bcd60e51b815260040161025f906124f8565b600081815260d060205260409081902080546001600160a01b0319811690915590516001600160a01b03909116907ffc5b6fb2b8ba31620717843fd7a36a4ad996612ff9f3ece7cba2900efb43bc2b906103b7908390859061252b565b6104a6610e46565b6104ae610e9f565b60006104ba85856107f0565b6001600160a01b0316146104d9576104d484848484610ee5565b61052d565b60405162461bcd60e51b8152602060048201526024808201527f4461766f734272696467652f776172702d64657374696e6174696f6e2d756e6b6044820152633737bbb760e11b606482015260840161025f565b6105376001609755565b50505050565b610545610da0565b6102cf60006112a5565b610557610da0565b6102cf6112f7565b600054610100900460ff161580801561057f5750600054600160ff909116105b806105995750303b158015610599575060005460ff166001145b6105fc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161025f565b6000805460ff19166001179055801561061f576000805461ff0019166101001790555b610627611334565b61062f611363565b610637611392565b60ca80546001600160a01b0319166001600160a01b038616179055604080516080810190915280610667856113c1565b8152602001610675846113c1565b8152602001468152602001846040516020016106919190612568565b60408051808303601f190181529181528151602092830120606090811c909352835160cb559083015160cc5582015160cd55015160ce80546001600160a01b0319166001600160a01b039092169190911790558015610537576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610737610da0565b60405163898855ed60e01b8152600481018390526001600160a01b0384169063898855ed90602401600060405180830381600087803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b5050604051630d6c7ef360e11b8152600481018490526001600160a01b0386169250631ad8fde69150602401600060405180830381600087803b1580156107d357600080fd5b505af11580156107e7573d6000803e3d6000fd5b50505050505050565b600081815260d06020908152604080832054905160d192849261082392889246926001600160a01b03169189910161259b565b60408051601f19818403018152918152815160209283012083529082019290925201600020546001600160a01b031690505b92915050565b610863610da0565b600082815260d060205260409020546001600160a01b03166108975760405162461bcd60e51b815260040161025f906125d4565b600082815260d0602090815260408083205490516108c792879246926001600160a01b039091169188910161259b565b60408051601f198184030181529181528151602092830120600081815260d19093529120549091506001600160a01b03166109445760405162461bcd60e51b815260206004820152601f60248201527f4461766f734272696467652f756e6b6e6f776e2d64657374696e6174696f6e00604482015260640161025f565b600081815260d1602052604080822080546001600160a01b0319169055516001600160a01b03848116928692918816917fbbcefea7388a2fce55f6f7bc8b8fb140e4a90100232f853b2892432748d185b89190a450505050565b6109a6610e46565b6109ae610e9f565b60048035810190602435016000806109c5836113e0565b9150915046826040015114610a305760405162461bcd60e51b815260206004820152602b60248201527f4461766f734272696467652f726563656970742d706f696e74732d746f2d616e60448201526a37ba3432b916b1b430b4b760a91b606482015260840161025f565b6000610a3b85611605565b60208401519091506001600160a01b0316610aa45760405162461bcd60e51b815260206004820152602360248201527f4461766f734272696467652f696e76616c69642d636f6e74726163744164647260448201526265737360e81b606482015260840161025f565b6020808401518251600090815260d09092526040909120546001600160a01b03908116911614610b245760405162461bcd60e51b815260206004820152602560248201527f4461766f734272696467652f6576656e742d66726f6d2d756e6b6e6f776e2d62604482015264726964676560d81b606482015260840161025f565b8787604051610b34929190612603565b604051908190039020835260016020820152825160c0820152610100812060ca546001600160a01b0316610b688289611649565b6001600160a01b031614610bba5760405162461bcd60e51b81526020600482015260196024820152784461766f734272696467652f6261642d7369676e617475726560381b604482015260640161025f565b610bc68484848461166d565b505050505050610bd66001609755565b5050505050565b610be5610da0565b600082815260d060205260409020546001600160a01b0316610c195760405162461bcd60e51b815260040161025f906125d4565b600082815260d060209081526040808320549051610c4992879246926001600160a01b039091169188910161259b565b60408051601f198184030181529181528151602092830120600081815260d19093529120549091506001600160a01b031615610cc75760405162461bcd60e51b815260206004820152601d60248201527f4461766f734272696467652f6b6e6f776e2d64657374696e6174696f6e000000604482015260640161025f565b600081815260d1602052604080822080546001600160a01b0319166001600160a01b03868116918217909255915191928692918816917fe28a125d78f695ba47a84c50686b72e8157091f96188b62d21945f155ec72d479190a450505050565b610d2f610da0565b6001600160a01b038116610d945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161025f565b610d9d816112a5565b50565b6033546001600160a01b031633146102cf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161025f565b610e0261174a565b6065805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610e3c919061224a565b60405180910390a1565b600260975403610e985760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161025f565b6002609755565b60655460ff16156102cf5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161025f565b600083815260d060205260409020546001600160a01b0316610f495760405162461bcd60e51b815260206004820152601f60248201527f4461766f734272696467652f6e6f6e2d6578697374696e672d62726964676500604482015260640161025f565b6040516370a0823160e01b815233906000906001600160a01b038716906370a0823190610f7a90859060040161224a565b602060405180830381865afa158015610f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbb9190612613565b604051632770a7eb60e21b81529091506001600160a01b03871690639dc29fac90610fec908590879060040161252b565b600060405180830381600087803b15801561100657600080fd5b505af115801561101a573d6000803e3d6000fd5b50506040516370a0823160e01b8152600092506001600160a01b03891691506370a082319061104d90869060040161224a565b602060405180830381865afa15801561106a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108e9190612613565b90508161109b8583612642565b146110f65760405162461bcd60e51b815260206004820152602560248201527f4461766f734272696467652f696e636f72726563742d7472616e736665722d616044820152641b5bdd5b9d60da1b606482015260840161025f565b600060405180608001604052806111738a6001600160a01b03166395d89b416040518163ffffffff1660e01b81526004016000604051808303816000875af1158015611146573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261116e9190810190612655565b6113c1565b81526020016111bb8a6001600160a01b03166306fdde036040518163ffffffff1660e01b81526004016000604051808303816000875af1158015611146573d6000803e3d6000fd5b8152600060208201819052604090910181905260c98054929350906111df836126cc565b9190505550856001600160a01b0316846001600160a01b03167fbb91bc033add952080918570fb6f133f59b480190b2e57e131fb76a6cc5a605b898b6112258d8d6107f0565b61122f8e8c611793565b60c954604080519586526001600160a01b03948516602080880191909152938516868201526060808701939093526080860191909152885160a08601529188015160c08501529087015160e0840152860151166101008201526101200160405180910390a35050505050505050565b6001609755565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6112ff610e9f565b6065805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610e2f3390565b600054610100900460ff1661135b5760405162461bcd60e51b815260040161025f906126e5565b6102cf6118a7565b600054610100900460ff1661138a5760405162461bcd60e51b815260040161025f906126e5565b6102cf6118d7565b600054610100900460ff166113b95760405162461bcd60e51b815260040161025f906126e5565b6102cf61190a565b8051600090829082036113d75750600092915050565b50506020015190565b604080516101a081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081019190915260008061145f61145a856020612642565b611931565b90508061146b81611946565b91506114808161147b8185612730565b611951565b6001146114cf5760405162461bcd60e51b815260206004820181905260248201527f457468657265756d56657269666965723a207478206973207265766572746564604482015260640161025f565b506114d981611946565b9050806114e581611946565b915060006114f282611931565b90505b8281101561159c578061150781611946565b915060006115158783611966565b9050600081600181111561152b5761152b612743565b1461159557600086600181111561154457611544612743565b146115915760405162461bcd60e51b815260206004820152601f60248201527f457468657265756d56657269666965723a206d756c7469706c65206c6f677300604482015260640161025f565b8095505b50506114f5565b60008460018111156115b0576115b0612743565b036115fd5760405162461bcd60e51b815260206004820152601e60248201527f457468657265756d56657269666965723a206d697373696e67206c6f67730000604482015260640161025f565b505050915091565b61160d612148565b611615612148565b6000611622846020612642565b90506020818337604081019050608081604084013760a00160208160e08401375092915050565b60008060006116588585611afb565b9150915061166581611b40565b509392505050565b600081815260cf602052604090205460ff16156116c55760405162461bcd60e51b81526020600482015260166024820152752230bb37b9a13934b233b297bab9b2b216b83937b7b360511b604482015260640161025f565b600081815260cf60205260409020805460ff191660019081179091558360018111156116f3576116f3612743565b03611707576117028483611c85565b610537565b60405162461bcd60e51b81526020600482015260186024820152774461766f734272696467652f696e76616c69642d7479706560401b604482015260640161025f565b60655460ff166102cf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161025f565b60006012836001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af11580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fb9190612759565b60ff16111561181c5760405162461bcd60e51b815260040161025f9061277c565b826001600160a01b031663313ce5676040518163ffffffff1660e01b81526004016020604051808303816000875af115801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190612759565b61188b9060126127b3565b61189690600a6128b0565b6118a090836128bf565b9392505050565b600054610100900460ff166118ce5760405162461bcd60e51b815260040161025f906126e5565b6102cf336112a5565b600054610100900460ff166118fe5760405162461bcd60e51b815260040161025f906126e5565b6065805460ff19169055565b600054610100900460ff1661129e5760405162461bcd60e51b815260040161025f906126e5565b600061193c82611f17565b6108559083612642565b600061193c82611f91565b600061195c83611f17565b6118a09083612730565b60008061197283611931565b905060008161198081611946565b925061198b81612034565b91506000905080808461199d81611946565b95506119a881611f91565b6065146119be5760009650505050505050610855565b6119c781611931565b9050600181013593506119d981611946565b905060018101356001600160a01b031692506119f481611946565b905060018101356001600160a01b03169150611a0f81611946565b9050858114611a1d57600080fd5b506000611a2986611931565b9050611a3486611946565b95506000611a428288612730565b905060007fbb91bc033add952080918570fb6f133f59b480190b2e57e131fb76a6cc5a605b8603611a7a575060019750610120611a8b565b600098505050505050505050610855565b808214611aa357600098505050505050505050610855565b50813560408b01819052611ab8602084612642565b9250611ac5602083612730565b91505060a08a01818382375050506001600160a01b03938416602089015290831660608801529091166080860152505092915050565b6000808251604103611b315760208301516040840151606085015160001a611b2587828585612041565b94509450505050611b39565b506000905060025b9250929050565b6000816004811115611b5457611b54612743565b03611b5c5750565b6001816004811115611b7057611b70612743565b03611bb85760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161025f565b6002816004811115611bcc57611bcc612743565b03611c195760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161025f565b6003816004811115611c2d57611c2d612743565b03610d9d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161025f565b60a08201516001600160a01b0316611cdf5760405162461bcd60e51b815260206004820152601d60248201527f4461766f734272696467652f696e76616c69642d66726f6d546f6b656e000000604482015260640161025f565b8160a001516001600160a01b0316611cff8360c0015183600001516107f0565b6001600160a01b031614611d695760405162461bcd60e51b815260206004820152602b60248201527f4461766f734272696467652f6272696467652d66726f6d2d756e6b6e6f776e2d60448201526a3232b9ba34b730ba34b7b760a91b606482015260840161025f565b60008260c001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd19190612759565b905060128160ff161115611df75760405162461bcd60e51b815260040161025f9061277c565b6000611e048260126127b3565b611e0f90600a6128b0565b8460e00151611e1e91906128de565b90508360c001516001600160a01b03166340c10f198560800151836040518363ffffffff1660e01b8152600401611e5692919061252b565b600060405180830381600087803b158015611e7057600080fd5b505af1158015611e84573d6000803e3d6000fd5b5050505083608001516001600160a01b031684606001516001600160a01b03167f7ef13c4fefd7825b89456cad661f67d3969e8c54ff26aa038aa13d904b7b98b086600001518760a001518860c001518960e00151604051611f0994939291909384526001600160a01b03928316602085015291166040830152606082015260800190565b60405180910390a350505050565b60008135811a6080811015611f2f5750600092915050565b60b8811080611f4a575060c08110801590611f4a575060f881105b15611f585750600192915050565b60c0811015611f8557611f6d600160b86127b3565b611f7a9060ff1682612730565b6118a0906001612642565b611f6d600160f86127b3565b6000808235811a6080811015611faa576001915061202d565b60b8811015611fd057611fbe608082612730565b611fc9906001612642565b915061202d565b60c0811015611ffb576001939093019283356008602083900360b701021c810160b51901915061202d565b60f881101561200f57611fbe60c082612730565b6001939093019283356008602083900360f701021c810160f5190191505b5092915050565b60006108558260156120fb565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561206e57506000905060036120f2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156120c2573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166120eb576000600192509250506120f2565b9150600090505b94509492505050565b6000808211801561210d575060218211155b61211657600080fd5b600061212184611f17565b9050600061212f8285612730565b94909101356020949094036008029390931c9392505050565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081019190915290565b80356001600160a01b03811681146121a357600080fd5b919050565b6000602082840312156121ba57600080fd5b6118a08261218c565b600080604083850312156121d657600080fd5b6121df8361218c565b946020939093013593505050565b6000602082840312156121ff57600080fd5b5035919050565b6000806000806080858703121561221c57600080fd5b6122258561218c565b93506020850135925061223a6040860161218c565b9396929550929360600135925050565b6001600160a01b0391909116815260200190565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561229d5761229d61225e565b604052919050565b600067ffffffffffffffff8211156122bf576122bf61225e565b50601f01601f191660200190565b60006122e06122db846122a5565b612274565b90508281528383830111156122f457600080fd5b828260208301376000602084830101529392505050565b600082601f83011261231c57600080fd5b6118a0838335602085016122cd565b60008060006060848603121561234057600080fd5b6123498461218c565b9250602084013567ffffffffffffffff8082111561236657600080fd5b6123728783880161230b565b9350604086013591508082111561238857600080fd5b506123958682870161230b565b9150509250925092565b6000806000606084860312156123b457600080fd5b6123bd8461218c565b95602085013595506040909401359392505050565b6000806000606084860312156123e757600080fd5b6123f08461218c565b9250602084013591506124056040850161218c565b90509250925092565b60008083601f84011261242057600080fd5b50813567ffffffffffffffff81111561243857600080fd5b602083019150836020828501011115611b3957600080fd5b60008060008060006060868803121561246857600080fd5b853567ffffffffffffffff8082111561248057600080fd5b61248c89838a0161240e565b909750955060208801359150808211156124a557600080fd5b6124b189838a0161240e565b909550935060408801359150808211156124ca57600080fd5b508601601f810188136124dc57600080fd5b6124eb888235602084016122cd565b9150509295509295909350565b6020808252601990820152782230bb37b9a13934b233b297b4b73b30b634b216b1b430b4b760391b604082015260600190565b6001600160a01b03929092168252602082015260400190565b60005b8381101561255f578181015183820152602001612547565b50506000910152565b6a4461766f7342726964676560a81b81526000825161258e81600b850160208701612544565b91909101600b0192915050565b6bffffffffffffffffffffffff19606095861b8116825260148201949094529190931b9091166034820152604881019190915260680190565b6020808252601590820152742230bb37b9a13934b233b297b130b216b1b430b4b760591b604082015260600190565b8183823760009101908152919050565b60006020828403121561262557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156108555761085561262c565b60006020828403121561266757600080fd5b815167ffffffffffffffff81111561267e57600080fd5b8201601f8101841361268f57600080fd5b805161269d6122db826122a5565b8181528560208385010111156126b257600080fd5b6126c3826020830160208601612544565b95945050505050565b6000600182016126de576126de61262c565b5060010190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b818103818111156108555761085561262c565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561276b57600080fd5b815160ff811681146118a057600080fd5b6020808252601d908201527f4461766f734272696467652f646563696d616c732d6f766572666c6f77000000604082015260600190565b60ff82811682821603908111156108555761085561262c565b600181815b808511156128075781600019048211156127ed576127ed61262c565b808516156127fa57918102915b93841c93908002906127d1565b509250929050565b60008261281e57506001610855565b8161282b57506000610855565b8160018114612841576002811461284b57612867565b6001915050610855565b60ff84111561285c5761285c61262c565b50506001821b610855565b5060208310610133831016604e8410600b841016171561288a575081810a610855565b61289483836127cc565b80600019048211156128a8576128a861262c565b029392505050565b60006118a060ff84168361280f565b60008160001904831182151516156128d9576128d961262c565b500290565b6000826128fb57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220cf2dd1524e07985223f7906470b19817746139da52f255889703ab24dd1aaf5564736f6c63430008100033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.