false
true
0

Contract Address Details

0x0155aE6b7283a2dD6a69C4513f5b9dDB254fc579

Contract Name
Bridge
Creator
0xea2157–321bb9 at 0x827e0c–9971ef
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
27891573
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
Bridge




Optimization enabled
true
Compiler version
v0.8.4+commit.c7e474f2




Optimization runs
100
EVM Version
istanbul




Verified at
2026-05-17T07:22:39.032869Z

contracts/contracts/Bridge.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "../interfaces/IBridgeInbound.sol";
import "../interfaces/IBridgeOutbound.sol";
import "../interfaces/IMintableBurnableERC20.sol";
import "../interfaces/IRegistry.sol";
import "../interfaces/IFederation.sol";
import "../libraries/Utils.sol";

contract Bridge is
    IBridgeInbound,
    IBridgeOutbound,
    OwnableUpgradeable,
    PausableUpgradeable,
    ReentrancyGuardUpgradeable {
    using Utils for *;
    using SafeERC20Upgradeable for IMintableBurnableERC20;
    using AddressUpgradeable for address;

    IRegistry public tokenRegistry;
    IFederation public override federation;

    mapping(bytes32 => uint256) public override processed;

    function initialize(address tokenRegistry_) public initializer {
        PausableUpgradeable.__Pausable_init();
        OwnableUpgradeable.__Ownable_init();
        ReentrancyGuardUpgradeable.__ReentrancyGuard_init();
        tokenRegistry = IRegistry(tokenRegistry_);
    }

    function setFederation(address federation_) external onlyOwner {
        require(federation_.isContract(), "input not contract addr");
        federation = IFederation(federation_);
    }

    function isTransferProcessed(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) external view override returns(bool) {
        return processed[Utils.getTransferId(
            srcChainID_,
            srcChainTokenAddress_,
            dstChainTokenAddress_,
            receiver_,
            amount_,
            transactionHash_,
            logIndex_
        )] > 0;
    }
    // function isCallProcessed(
    //     uint256 srcChainID_,
    //     address srcChainTokenAddress_,
    //     address dstChainTokenAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external view override returns(bool) {
    //     return processed[Utils.getCallId(
    //         srcChainID_,
    //         srcChainTokenAddress_,
    //         dstChainTokenAddress_,
    //         transactionHash_,
    //         logIndex_,
    //         payload
    //     )] > 0;
    // }

    function acceptTransfer(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) external override onlyFederation {
        require(dstChainTokenAddress_ != address(0), "Bridge: destination chain token address is null");
        require(srcChainTokenAddress_ != address(0), "Bridge: src chain token address is null");
        require(receiver_ != address(0), "Bridge: Receiver is null");
        require(amount_ > 0, "Bridge: Amount 0");
        require(transactionHash_ != bytes32(0), "Bridge: Transaction is null");
        require(srcChainTokenAddress_ != address(0), "src token address is null");
        require(tokenRegistry.tokenRegistry(dstChainTokenAddress_, srcChainID_) == srcChainTokenAddress_, "Token Not Registered");
        bytes32 processId = Utils.getTransferId(
            srcChainID_,
            srcChainTokenAddress_,
            dstChainTokenAddress_,
            receiver_,
            amount_,
            transactionHash_,
            logIndex_
        );
        require(processed[processId] == 0, "Bridge: Already processed");
        processed[processId] = block.number;
        IMintableBurnableERC20(dstChainTokenAddress_).mint(receiver_, amount_);
        emit TransferAccepted(
            srcChainID_,
            transactionHash_,
            receiver_,
            srcChainTokenAddress_,
            dstChainTokenAddress_,
            amount_,
            logIndex_
        );
    }

    // function acceptCall(
    //     uint256 srcChainID_,
    //     address srcChainTokenAddress_,
    //     address dstChainTokenAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external override onlyFederation nonReentrant {
    //     require(dstChainTokenAddress_ != address(0), "Bridge: destination chain token address is null");
    //     require(srcChainTokenAddress_ != address(0), "Bridge: src chain token address is null");
    //     require(transactionHash_ != bytes32(0), "Bridge: Transaction is null");
    //     require(srcChainTokenAddress_ != address(0), "src token address is null");
    //     bytes4 sig =
    //         payload[0] |
    //         (bytes4(payload[1]) >> 8) |
    //         (bytes4(payload[2]) >> 16) |
    //         (bytes4(payload[3]) >> 24);

    //     bytes32 callRegistryID = Utils.getCallRegistryId(
    //         srcChainID_,
    //         srcChainTokenAddress_,
    //         dstChainTokenAddress_,
    //         sig
    //     );
    //     require(tokenRegistry.callRegistry(callRegistryID), "Call Not Registered");
    //     bytes32 callId = Utils.getCallId(
    //         srcChainID_,
    //         srcChainTokenAddress_,
    //         dstChainTokenAddress_,
    //         transactionHash_,
    //         logIndex_,
    //         payload
    //     );

    //     require(processed[callId] == 0, "Bridge: Already processed");
    //     processed[callId] = block.number;

    //     // call the function
    //     (bool success, ) = dstChainTokenAddress_.call(payload);
    //     require(success, "call fail");
    // }

    function bridgeTokenAt(
        uint256 dstChainId_,
        address srcChainTokenAddr_,
        uint256 amount_,
        address dstChainReceiverAddr_
    ) external override whenNotPaused nonReentrant {
        _bridgeToken(
            srcChainTokenAddr_,
            dstChainId_,
            amount_,
            dstChainReceiverAddr_
        );
    }

    function bridgeToken(
        uint256 dstChainId_,
        address srcChainTokenAddr_,
        uint256 amount_
    ) external override whenNotPaused nonReentrant {

        _bridgeToken(
            srcChainTokenAddr_,
            dstChainId_,
            amount_,
            _msgSender()
        );
    }

    function _bridgeToken(
        address srcChainTokenAddr_,
        uint256 dstChainId_,
        uint256 amount_,
        address dstChainReceiverAddr_
    ) internal {
        address dstChainTokenAddr_ = tokenRegistry.tokenRegistry(srcChainTokenAddr_, dstChainId_);
        require(dstChainTokenAddr_ != address(0), "Token Not Registered");
        //Transfer the tokens on IERC20, they should be already Approved for the bridge Address to use them
        IMintableBurnableERC20(srcChainTokenAddr_).safeTransferFrom(
            _msgSender(),
            address(this),
            amount_
        );
        _crossTokens(
            srcChainTokenAddr_,
            dstChainId_,
            dstChainTokenAddr_,
            dstChainReceiverAddr_,
            amount_
        );
    }

    function _crossTokens(
        address srcChainTokenAddr_,
        uint256 dstChainId_,
        address dstChainTokenAddr_,
        address dstChainReceiverAddr_,
        uint256 amount_
    ) internal {
        IMintableBurnableERC20 localToken = IMintableBurnableERC20(srcChainTokenAddr_);
        uint256 fee = _calculateFee(srcChainTokenAddr_, amount_);
        if (fee > 0) {
            localToken.safeTransfer(owner(), fee);
        }
        uint256 amountToCross = amount_ - fee;
        localToken.burn(address(this), amountToCross);
        emit Cross(
            _msgSender(),
            srcChainTokenAddr_,
            dstChainId_,
            dstChainTokenAddr_,
            dstChainReceiverAddr_,
            amountToCross,
            fee
        );
    }

    function _calculateFee(address srcChainTokenAddr_, uint256 amount_) internal view returns(uint256) {
        uint256 feeIn18 = tokenRegistry.fee(srcChainTokenAddr_);
        return amount_ * feeIn18 / 1e18;
    }

    modifier onlyFederation() {
        require(msg.sender == address(federation), "Bridge: Sender not Federation");
        _;
    }
}

        

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

/IERC20Upgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

/Initializable.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

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

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

/ContextUpgradeable.sol

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

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

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

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

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

/IFederation.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;

interface IFederation {
    event VotedTransfer(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 indexed transactionHash_,
        uint32 logIndex_,
        address indexed federator,
        bytes32 indexed processId);
    event VotedCall(
        uint256 srcChainID_,
        address srcChainContractAddress_,
        address dstChainContractAddress_,
        bytes32 indexed transactionHash_,
        uint32 logIndex_,
        address indexed federator,
        bytes32 indexed processId,
        bytes payload
    );

    event ExecutedCall(bytes32 indexed processId);
    event ExecutedTransfer(bytes32 indexed processId);
    event MemberAddition(address indexed member);
    event MemberRemoval(address indexed member);
    event RequirementChange(uint required);
    event BridgeChanged(address bridge);
    function voteTransfer(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) external;
    function hasVotedTransfer(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) external view returns(bool);

    function isTransferProcessed(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) external view returns(bool);


    // function voteCall(
    //     uint256 srcChainID_,
    //     address srcChainContractAddress_,
    //     address dstChainContractAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external;

    // function hasVotedCall(
    //     uint256 srcChainID_,
    //     address srcChainContractAddress_,
    //     address dstChainContractAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external view returns(bool);

    // function isCallProcessed(
    //     uint256 srcChainID_,
    //     address srcChainContractAddress_,
    //     address dstChainContractAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external view returns(bool);

    function getVoteCount(bytes32 processId) external view returns(uint);



    function setRequired(uint _required) external;

}
          

/IMintableBurnableERC20.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";

interface IMintableBurnableERC20 is IERC20MetadataUpgradeable {
    function mint(address account, uint256 amount) external;
    function burn(address account, uint256 amount) external;
}
          

/utils/SafeERC20Upgradeable.sol

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

pragma solidity ^0.8.0;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20Upgradeable {
    using AddressUpgradeable for address;

    function safeTransfer(
        IERC20Upgradeable token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20Upgradeable token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
          

/AddressUpgradeable.sol

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/ReentrancyGuardUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

/IRegistry.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;

interface IRegistry {

    function fee(address localAddr) external view returns(uint256);
    function tokenRegistry(address localAddress, uint256 alienChainId) external view returns(address);
    function callRegistry(bytes32 callId) external view returns(bool);
    function registerToken(address localAddress, uint256 alienChainId, address alienAddress) external;
    function unregisterToken(address localAddress, uint256 alienChainId, address alienAddress) external;
    function setFee(address localAddr, uint256 _feeConst) external;


    event TokenRegistered(address indexed localAddress, uint256 indexed alienChainId, address indexed alienTokenAddress);
    event TokenUnregistered(address indexed localAddress, uint256 indexed alienChainId, address indexed alienTokenAddress);


    // event CallRegistered(uint256 indexed alienChainId_, address indexed alienChainContractAddr_, address indexed localChainContractAddr_, bytes4 callSig_);
    // event CallUnregistered(uint256 indexed alienChainId_, address indexed alienChainContractAddr_, address indexed localChainContractAddr_, bytes4 callSig_);

    event FeeChanged(address indexed localAddr, uint256 _feeConst);
}
          

/IBridgeOutbound.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;

import "./IRegistry.sol";
import "./IFederation.sol";

interface IBridgeOutbound {
    // function tokenRegistry() external returns (IRegistry);
    function bridgeTokenAt(
        uint256 dstChainID,
        address srcChainTokenAddress,
        uint256 amount,
        address dstReceiverAddress
    ) external;
    function bridgeToken(
        uint256 dstChainID,
        address srcChainTokenAddress,
        uint256 amount
    ) external;
    event Cross(
        address indexed srcChainSenderAddress,
        address indexed srcChainTokenAddress,
        uint256 indexed dstChainID,
        address dstChainTokenAddress,
        address dstChainReceiverAddr,
        uint256 amountToCross,
        uint256 feeCollected
    );
}
          

/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

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

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

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

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

/Utils.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.4;
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";

library Utils {
    // function getCallRegistryId(
    //     uint256 alienChainId_,
    //     address alienChainContractAddr_,
    //     address localChainContractAddr_,
    //     bytes4 callSig_
    // ) internal pure returns(bytes32) {
    //     return keccak256(abi.encodePacked(
    //         alienChainId_,
    //         alienChainContractAddr_,
    //         localChainContractAddr_,
    //         callSig_
    //     ));
    // }

    function getTokenRegistryId(
        uint256 fromChainID,
        address alienAddress
    ) internal pure returns(bytes32) {
        return keccak256(abi.encodePacked(
            fromChainID,
            alienAddress
        ));
    }

    function getTransferId(
        uint256 srcChainID_,
        address srcChainTokenAddress_,
        address dstChainTokenAddress_,
        address receiver_,
        uint256 amount_,
        bytes32 transactionHash_,
        uint32 logIndex_
    ) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(
            "Transfer",
            srcChainID_,
            srcChainTokenAddress_,
            dstChainTokenAddress_,
            receiver_,
            amount_,
            transactionHash_,
            logIndex_
        ));
    }
    // function getCallId(
    //     uint256 srcChainID_,
    //     address srcChainTokenAddress_,
    //     address dstChainTokenAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) internal pure returns (bytes32) {
    //     return keccak256(abi.encodePacked(
    //         "Call",
    //         srcChainID_,
    //         srcChainTokenAddress_,
    //         dstChainTokenAddress_,
    //         transactionHash_,
    //         logIndex_,
    //         payload
    //     ));
    // }

    function getTokenInfo(address tokenToUse) internal view returns (uint8 decimals, string memory symbol) {
        return (
            getDecimals(tokenToUse),
            getSymbol(tokenToUse)
        );
    }

    function getSymbol(address tokenToUse) internal view returns (string memory symbol) {
        return IERC20MetadataUpgradeable(tokenToUse).symbol();
    }

    function getDecimals(address tokenToUse) internal view returns (uint8) {
        return IERC20MetadataUpgradeable(tokenToUse).decimals();
    }

}
          

/IBridgeInbound.sol

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.5.0;

import "./IRegistry.sol";
import "./IFederation.sol";

interface IBridgeInbound {
    event TransferAccepted(
        uint256 indexed sourceChainId,
        bytes32 indexed sourceHash,
        address indexed receiver_,
        address sourceToken,
        address destinationToken,
        uint256 amount,
        uint32 logIndex
    );

    function federation() external returns (IFederation);
    function processed(bytes32) external view returns(uint256);
    /**
     * Accepts the transaction from the other chain that was voted and sent by the federation contract
     */
    function acceptTransfer(
        uint256 srcChainID,
        address srcChainTokenAddress,
        address dstChainTokenAddress,
        address receiver,
        uint256 amount,
        bytes32 transactionHash,
        uint32 logIndex
    ) external;

    // function acceptCall(
    //     uint256 srcChainID_,
    //     address srcChainTokenAddress_,
    //     address dstChainTokenAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external;

    function isTransferProcessed(
        uint256 srcChainID,
        address srcChainTokenAddress,
        address dstChainTokenAddress,
        address receiver,
        uint256 amount,
        bytes32 transactionHash,
        uint32 logIndex
    ) external view returns(bool);

    // function isCallProcessed(
    //     uint256 srcChainID_,
    //     address srcChainTokenAddress_,
    //     address dstChainTokenAddress_,
    //     bytes32 transactionHash_,
    //     uint32 logIndex_,
    //     bytes calldata payload
    // ) external view returns(bool);
}
          

/PausableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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());
    }
    uint256[49] private __gap;
}
          

Compiler Settings

{"remappings":[],"optimizer":{"runs":100,"enabled":true},"metadata":{"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/contracts/Bridge.sol":"Bridge"}}
              

Contract ABI

[{"type":"event","name":"Cross","inputs":[{"type":"address","name":"srcChainSenderAddress","internalType":"address","indexed":true},{"type":"address","name":"srcChainTokenAddress","internalType":"address","indexed":true},{"type":"uint256","name":"dstChainID","internalType":"uint256","indexed":true},{"type":"address","name":"dstChainTokenAddress","internalType":"address","indexed":false},{"type":"address","name":"dstChainReceiverAddr","internalType":"address","indexed":false},{"type":"uint256","name":"amountToCross","internalType":"uint256","indexed":false},{"type":"uint256","name":"feeCollected","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TransferAccepted","inputs":[{"type":"uint256","name":"sourceChainId","internalType":"uint256","indexed":true},{"type":"bytes32","name":"sourceHash","internalType":"bytes32","indexed":true},{"type":"address","name":"receiver_","internalType":"address","indexed":true},{"type":"address","name":"sourceToken","internalType":"address","indexed":false},{"type":"address","name":"destinationToken","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint32","name":"logIndex","internalType":"uint32","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"acceptTransfer","inputs":[{"type":"uint256","name":"srcChainID_","internalType":"uint256"},{"type":"address","name":"srcChainTokenAddress_","internalType":"address"},{"type":"address","name":"dstChainTokenAddress_","internalType":"address"},{"type":"address","name":"receiver_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"},{"type":"bytes32","name":"transactionHash_","internalType":"bytes32"},{"type":"uint32","name":"logIndex_","internalType":"uint32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bridgeToken","inputs":[{"type":"uint256","name":"dstChainId_","internalType":"uint256"},{"type":"address","name":"srcChainTokenAddr_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"bridgeTokenAt","inputs":[{"type":"uint256","name":"dstChainId_","internalType":"uint256"},{"type":"address","name":"srcChainTokenAddr_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"},{"type":"address","name":"dstChainReceiverAddr_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IFederation"}],"name":"federation","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"tokenRegistry_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isTransferProcessed","inputs":[{"type":"uint256","name":"srcChainID_","internalType":"uint256"},{"type":"address","name":"srcChainTokenAddress_","internalType":"address"},{"type":"address","name":"dstChainTokenAddress_","internalType":"address"},{"type":"address","name":"receiver_","internalType":"address"},{"type":"uint256","name":"amount_","internalType":"uint256"},{"type":"bytes32","name":"transactionHash_","internalType":"bytes32"},{"type":"uint32","name":"logIndex_","internalType":"uint32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"processed","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFederation","inputs":[{"type":"address","name":"federation_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IRegistry"}],"name":"tokenRegistry","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x608060405234801561001057600080fd5b5061152d806100206000396000f3fe608060405234801561001057600080fd5b50600436106100bf5760003560e01c80637bd1ba9c1161007c5780637bd1ba9c146101525780638da5cb5b146101655780639a8177371461016d5780639d23c4c714610180578063c1f0808a14610193578063c4d66de8146101c1578063f2fde38b146101d457600080fd5b80630ffa1e30146100c45780631203a4e8146100d9578063239c9c81146100ec5780635c975abb1461011457806366c861191461011f578063715018a61461014a575b600080fd5b6100d76100d2366004611149565b6101e7565b005b6100d76100e7366004611253565b610292565b6100ff6100fa3660046111d1565b6102f3565b60405190151581526020015b60405180910390f35b60655460ff166100ff565b60ca54610132906001600160a01b031681565b6040516001600160a01b03909116815260200161010b565b6100d7610326565b6100d76101603660046111d1565b610361565b6101326107b4565b6100d761017b36600461128a565b6107c3565b60c954610132906001600160a01b031681565b6101b36101a13660046111a1565b60cb6020526000908152604090205481565b60405190815260200161010b565b6100d76101cf366004611149565b610825565b6100d76101e2366004611149565b610912565b336101f06107b4565b6001600160a01b03161461021f5760405162461bcd60e51b815260040161021690611393565b60405180910390fd5b6001600160a01b0381163b6102705760405162461bcd60e51b815260206004820152601760248201527634b7383aba103737ba1031b7b73a3930b1ba1030b2323960491b6044820152606401610216565b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b60655460ff16156102b55760405162461bcd60e51b815260040161021690611369565b600260975414156102d85760405162461bcd60e51b815260040161021690611413565b60026097556102e9828483336109b2565b5050600160975550565b60008060cb60006103098b8b8b8b8b8b8b610a86565b815260200190815260200160002054119050979650505050505050565b3361032f6107b4565b6001600160a01b0316146103555760405162461bcd60e51b815260040161021690611393565b61035f6000610b14565b565b60ca546001600160a01b031633146103bb5760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a2053656e646572206e6f742046656465726174696f6e0000006044820152606401610216565b6001600160a01b0385166104295760405162461bcd60e51b815260206004820152602f60248201527f4272696467653a2064657374696e6174696f6e20636861696e20746f6b656e2060448201526e1859191c995cdcc81a5cc81b9d5b1b608a1b6064820152608401610216565b6001600160a01b03861661048f5760405162461bcd60e51b815260206004820152602760248201527f4272696467653a2073726320636861696e20746f6b656e2061646472657373206044820152661a5cc81b9d5b1b60ca1b6064820152608401610216565b6001600160a01b0384166104e05760405162461bcd60e51b8152602060048201526018602482015277109c9a5919d94e88149958d95a5d995c881a5cc81b9d5b1b60421b6044820152606401610216565b600083116105235760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b6044820152606401610216565b816105705760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a205472616e73616374696f6e206973206e756c6c00000000006044820152606401610216565b6001600160a01b0386166105c25760405162461bcd60e51b81526020600482015260196024820152781cdc98c81d1bdad95b881859191c995cdcc81a5cc81b9d5b1b603a1b6044820152606401610216565b60c95460405163102fc64360e01b81526001600160a01b0380891692169063102fc643906105f69089908c906004016112ef565b60206040518083038186803b15801561060e57600080fd5b505afa158015610622573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106469190611165565b6001600160a01b03161461066c5760405162461bcd60e51b81526004016102169061133b565b600061067d88888888888888610a86565b600081815260cb6020526040902054909150156106d85760405162461bcd60e51b8152602060048201526019602482015278109c9a5919d94e88105b1c9958591e481c1c9bd8d95cdcd959603a1b6044820152606401610216565b600081815260cb602052604090819020439055516340c10f1960e01b81526001600160a01b038716906340c10f199061071790889088906004016112ef565b600060405180830381600087803b15801561073157600080fd5b505af1158015610745573d6000803e3d6000fd5b5050604080516001600160a01b038b811682528a8116602083015291810188905263ffffffff8616606082015290881692508591508a907f799cda3f32c738aac9e37166c2c09ff88cc26405bc1feaffab6939e3000deb85906080015b60405180910390a45050505050505050565b6033546001600160a01b031690565b60655460ff16156107e65760405162461bcd60e51b815260040161021690611369565b600260975414156108095760405162461bcd60e51b815260040161021690611413565b600260975561081a838584846109b2565b505060016097555050565b600054610100900460ff166108405760005460ff1615610844565b303b155b6108a75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610216565b600054610100900460ff161580156108c9576000805461ffff19166101011790555b6108d1610b66565b6108d9610b9d565b6108e1610bd4565b60c980546001600160a01b0319166001600160a01b038416179055801561090e576000805461ff00191690555b5050565b3361091b6107b4565b6001600160a01b0316146109415760405162461bcd60e51b815260040161021690611393565b6001600160a01b0381166109a65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610216565b6109af81610b14565b50565b60c95460405163102fc64360e01b81526000916001600160a01b03169063102fc643906109e590889088906004016112ef565b60206040518083038186803b1580156109fd57600080fd5b505afa158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a359190611165565b90506001600160a01b038116610a5d5760405162461bcd60e51b81526004016102169061133b565b610a726001600160a01b038616333086610c03565b610a7f8585838587610c74565b5050505050565b60408051672a3930b739b332b960c11b6020808301919091526028820199909952606097881b6bffffffffffffffffffffffff19908116604883015296881b8716605c8201529490961b9094166070840152608483019190915260a482015260e09190911b6001600160e01b03191660c4820152815160a881830301815260c8909101909152805191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b8d5760405162461bcd60e51b8152600401610216906113c8565b610b95610d79565b61035f610da0565b600054610100900460ff16610bc45760405162461bcd60e51b8152600401610216906113c8565b610bcc610d79565b61035f610dd3565b600054610100900460ff16610bfb5760405162461bcd60e51b8152600401610216906113c8565b61035f610e03565b6040516001600160a01b0380851660248301528316604482015260648101829052610c6e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e31565b50505050565b846000610c818284610f08565b90508015610ca557610ca5610c946107b4565b6001600160a01b0384169083610fb0565b6000610cb18285611489565b604051632770a7eb60e21b81529091506001600160a01b03841690639dc29fac90610ce290309085906004016112ef565b600060405180830381600087803b158015610cfc57600080fd5b505af1158015610d10573d6000803e3d6000fd5b5050505086886001600160a01b0316610d263390565b604080516001600160a01b038b811682528a81166020830152918101869052606081018790529116907f1bb79adaf05ec7ad585efe40b1b76628ac08a50909f910dd0e7a813730aee6cd906080016107a2565b600054610100900460ff1661035f5760405162461bcd60e51b8152600401610216906113c8565b600054610100900460ff16610dc75760405162461bcd60e51b8152600401610216906113c8565b6065805460ff19169055565b600054610100900460ff16610dfa5760405162461bcd60e51b8152600401610216906113c8565b61035f33610b14565b600054610100900460ff16610e2a5760405162461bcd60e51b8152600401610216906113c8565b6001609755565b6000610e86826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fcf9092919063ffffffff16565b805190915015610f035780806020019051810190610ea49190611181565b610f035760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610216565b505050565b60c954604051636fcca69b60e01b81526001600160a01b0384811660048301526000928392911690636fcca69b9060240160206040518083038186803b158015610f5157600080fd5b505afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8991906111b9565b9050670de0b6b3a7640000610f9e828561146a565b610fa8919061144a565b949350505050565b610f038363a9059cbb60e01b8484604051602401610c379291906112ef565b6060610fde8484600085610fe8565b90505b9392505050565b6060824710156110495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610216565b843b6110975760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610216565b600080866001600160a01b031685876040516110b391906112d3565b60006040518083038185875af1925050503d80600081146110f0576040519150601f19603f3d011682016040523d82523d6000602084013e6110f5565b606091505b5091509150611105828286611110565b979650505050505050565b6060831561111f575081610fe1565b82511561112f5782518084602001fd5b8160405162461bcd60e51b81526004016102169190611308565b60006020828403121561115a578081fd5b8135610fe1816114e2565b600060208284031215611176578081fd5b8151610fe1816114e2565b600060208284031215611192578081fd5b81518015158114610fe1578182fd5b6000602082840312156111b2578081fd5b5035919050565b6000602082840312156111ca578081fd5b5051919050565b600080600080600080600060e0888a0312156111eb578283fd5b8735965060208801356111fd816114e2565b9550604088013561120d816114e2565b9450606088013561121d816114e2565b93506080880135925060a0880135915060c088013563ffffffff81168114611243578182fd5b8091505092959891949750929550565b600080600060608486031215611267578283fd5b833592506020840135611279816114e2565b929592945050506040919091013590565b6000806000806080858703121561129f578384fd5b8435935060208501356112b1816114e2565b92506040850135915060608501356112c8816114e2565b939692955090935050565b600082516112e58184602087016114a0565b9190910192915050565b6001600160a01b03929092168252602082015260400190565b60208152600082518060208401526113278160408501602087016114a0565b601f01601f19169190910160400192915050565b602080825260149082015273151bdad95b88139bdd08149959da5cdd195c995960621b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008261146557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611484576114846114cc565b500290565b60008282101561149b5761149b6114cc565b500390565b60005b838110156114bb5781810151838201526020016114a3565b83811115610c6e5750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146109af57600080fdfea26469706673582212201fe7cc1a6f4a2bcdb9b27d17a2c2915fcea91e0697abfc76b0bfddfc2f252ffc64736f6c63430008040033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100bf5760003560e01c80637bd1ba9c1161007c5780637bd1ba9c146101525780638da5cb5b146101655780639a8177371461016d5780639d23c4c714610180578063c1f0808a14610193578063c4d66de8146101c1578063f2fde38b146101d457600080fd5b80630ffa1e30146100c45780631203a4e8146100d9578063239c9c81146100ec5780635c975abb1461011457806366c861191461011f578063715018a61461014a575b600080fd5b6100d76100d2366004611149565b6101e7565b005b6100d76100e7366004611253565b610292565b6100ff6100fa3660046111d1565b6102f3565b60405190151581526020015b60405180910390f35b60655460ff166100ff565b60ca54610132906001600160a01b031681565b6040516001600160a01b03909116815260200161010b565b6100d7610326565b6100d76101603660046111d1565b610361565b6101326107b4565b6100d761017b36600461128a565b6107c3565b60c954610132906001600160a01b031681565b6101b36101a13660046111a1565b60cb6020526000908152604090205481565b60405190815260200161010b565b6100d76101cf366004611149565b610825565b6100d76101e2366004611149565b610912565b336101f06107b4565b6001600160a01b03161461021f5760405162461bcd60e51b815260040161021690611393565b60405180910390fd5b6001600160a01b0381163b6102705760405162461bcd60e51b815260206004820152601760248201527634b7383aba103737ba1031b7b73a3930b1ba1030b2323960491b6044820152606401610216565b60ca80546001600160a01b0319166001600160a01b0392909216919091179055565b60655460ff16156102b55760405162461bcd60e51b815260040161021690611369565b600260975414156102d85760405162461bcd60e51b815260040161021690611413565b60026097556102e9828483336109b2565b5050600160975550565b60008060cb60006103098b8b8b8b8b8b8b610a86565b815260200190815260200160002054119050979650505050505050565b3361032f6107b4565b6001600160a01b0316146103555760405162461bcd60e51b815260040161021690611393565b61035f6000610b14565b565b60ca546001600160a01b031633146103bb5760405162461bcd60e51b815260206004820152601d60248201527f4272696467653a2053656e646572206e6f742046656465726174696f6e0000006044820152606401610216565b6001600160a01b0385166104295760405162461bcd60e51b815260206004820152602f60248201527f4272696467653a2064657374696e6174696f6e20636861696e20746f6b656e2060448201526e1859191c995cdcc81a5cc81b9d5b1b608a1b6064820152608401610216565b6001600160a01b03861661048f5760405162461bcd60e51b815260206004820152602760248201527f4272696467653a2073726320636861696e20746f6b656e2061646472657373206044820152661a5cc81b9d5b1b60ca1b6064820152608401610216565b6001600160a01b0384166104e05760405162461bcd60e51b8152602060048201526018602482015277109c9a5919d94e88149958d95a5d995c881a5cc81b9d5b1b60421b6044820152606401610216565b600083116105235760405162461bcd60e51b815260206004820152601060248201526f04272696467653a20416d6f756e7420360841b6044820152606401610216565b816105705760405162461bcd60e51b815260206004820152601b60248201527f4272696467653a205472616e73616374696f6e206973206e756c6c00000000006044820152606401610216565b6001600160a01b0386166105c25760405162461bcd60e51b81526020600482015260196024820152781cdc98c81d1bdad95b881859191c995cdcc81a5cc81b9d5b1b603a1b6044820152606401610216565b60c95460405163102fc64360e01b81526001600160a01b0380891692169063102fc643906105f69089908c906004016112ef565b60206040518083038186803b15801561060e57600080fd5b505afa158015610622573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106469190611165565b6001600160a01b03161461066c5760405162461bcd60e51b81526004016102169061133b565b600061067d88888888888888610a86565b600081815260cb6020526040902054909150156106d85760405162461bcd60e51b8152602060048201526019602482015278109c9a5919d94e88105b1c9958591e481c1c9bd8d95cdcd959603a1b6044820152606401610216565b600081815260cb602052604090819020439055516340c10f1960e01b81526001600160a01b038716906340c10f199061071790889088906004016112ef565b600060405180830381600087803b15801561073157600080fd5b505af1158015610745573d6000803e3d6000fd5b5050604080516001600160a01b038b811682528a8116602083015291810188905263ffffffff8616606082015290881692508591508a907f799cda3f32c738aac9e37166c2c09ff88cc26405bc1feaffab6939e3000deb85906080015b60405180910390a45050505050505050565b6033546001600160a01b031690565b60655460ff16156107e65760405162461bcd60e51b815260040161021690611369565b600260975414156108095760405162461bcd60e51b815260040161021690611413565b600260975561081a838584846109b2565b505060016097555050565b600054610100900460ff166108405760005460ff1615610844565b303b155b6108a75760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610216565b600054610100900460ff161580156108c9576000805461ffff19166101011790555b6108d1610b66565b6108d9610b9d565b6108e1610bd4565b60c980546001600160a01b0319166001600160a01b038416179055801561090e576000805461ff00191690555b5050565b3361091b6107b4565b6001600160a01b0316146109415760405162461bcd60e51b815260040161021690611393565b6001600160a01b0381166109a65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610216565b6109af81610b14565b50565b60c95460405163102fc64360e01b81526000916001600160a01b03169063102fc643906109e590889088906004016112ef565b60206040518083038186803b1580156109fd57600080fd5b505afa158015610a11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a359190611165565b90506001600160a01b038116610a5d5760405162461bcd60e51b81526004016102169061133b565b610a726001600160a01b038616333086610c03565b610a7f8585838587610c74565b5050505050565b60408051672a3930b739b332b960c11b6020808301919091526028820199909952606097881b6bffffffffffffffffffffffff19908116604883015296881b8716605c8201529490961b9094166070840152608483019190915260a482015260e09190911b6001600160e01b03191660c4820152815160a881830301815260c8909101909152805191012090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b8d5760405162461bcd60e51b8152600401610216906113c8565b610b95610d79565b61035f610da0565b600054610100900460ff16610bc45760405162461bcd60e51b8152600401610216906113c8565b610bcc610d79565b61035f610dd3565b600054610100900460ff16610bfb5760405162461bcd60e51b8152600401610216906113c8565b61035f610e03565b6040516001600160a01b0380851660248301528316604482015260648101829052610c6e9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610e31565b50505050565b846000610c818284610f08565b90508015610ca557610ca5610c946107b4565b6001600160a01b0384169083610fb0565b6000610cb18285611489565b604051632770a7eb60e21b81529091506001600160a01b03841690639dc29fac90610ce290309085906004016112ef565b600060405180830381600087803b158015610cfc57600080fd5b505af1158015610d10573d6000803e3d6000fd5b5050505086886001600160a01b0316610d263390565b604080516001600160a01b038b811682528a81166020830152918101869052606081018790529116907f1bb79adaf05ec7ad585efe40b1b76628ac08a50909f910dd0e7a813730aee6cd906080016107a2565b600054610100900460ff1661035f5760405162461bcd60e51b8152600401610216906113c8565b600054610100900460ff16610dc75760405162461bcd60e51b8152600401610216906113c8565b6065805460ff19169055565b600054610100900460ff16610dfa5760405162461bcd60e51b8152600401610216906113c8565b61035f33610b14565b600054610100900460ff16610e2a5760405162461bcd60e51b8152600401610216906113c8565b6001609755565b6000610e86826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610fcf9092919063ffffffff16565b805190915015610f035780806020019051810190610ea49190611181565b610f035760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610216565b505050565b60c954604051636fcca69b60e01b81526001600160a01b0384811660048301526000928392911690636fcca69b9060240160206040518083038186803b158015610f5157600080fd5b505afa158015610f65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8991906111b9565b9050670de0b6b3a7640000610f9e828561146a565b610fa8919061144a565b949350505050565b610f038363a9059cbb60e01b8484604051602401610c379291906112ef565b6060610fde8484600085610fe8565b90505b9392505050565b6060824710156110495760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610216565b843b6110975760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610216565b600080866001600160a01b031685876040516110b391906112d3565b60006040518083038185875af1925050503d80600081146110f0576040519150601f19603f3d011682016040523d82523d6000602084013e6110f5565b606091505b5091509150611105828286611110565b979650505050505050565b6060831561111f575081610fe1565b82511561112f5782518084602001fd5b8160405162461bcd60e51b81526004016102169190611308565b60006020828403121561115a578081fd5b8135610fe1816114e2565b600060208284031215611176578081fd5b8151610fe1816114e2565b600060208284031215611192578081fd5b81518015158114610fe1578182fd5b6000602082840312156111b2578081fd5b5035919050565b6000602082840312156111ca578081fd5b5051919050565b600080600080600080600060e0888a0312156111eb578283fd5b8735965060208801356111fd816114e2565b9550604088013561120d816114e2565b9450606088013561121d816114e2565b93506080880135925060a0880135915060c088013563ffffffff81168114611243578182fd5b8091505092959891949750929550565b600080600060608486031215611267578283fd5b833592506020840135611279816114e2565b929592945050506040919091013590565b6000806000806080858703121561129f578384fd5b8435935060208501356112b1816114e2565b92506040850135915060608501356112c8816114e2565b939692955090935050565b600082516112e58184602087016114a0565b9190910192915050565b6001600160a01b03929092168252602082015260400190565b60208152600082518060208401526113278160408501602087016114a0565b601f01601f19169190910160400192915050565b602080825260149082015273151bdad95b88139bdd08149959da5cdd195c995960621b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008261146557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611484576114846114cc565b500290565b60008282101561149b5761149b6114cc565b500390565b60005b838110156114bb5781810151838201526020016114a3565b83811115610c6e5750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146109af57600080fdfea26469706673582212201fe7cc1a6f4a2bcdb9b27d17a2c2915fcea91e0697abfc76b0bfddfc2f252ffc64736f6c63430008040033