synapsecns/sanguine

View on GitHub
services/explorer/contracts/user/dfk/dfkpet/dfkpet.contractinfo.json

Summary

Maintainability
Test Coverage
{"solidity/PetBridgeUpgradeable.sol:AddressUpgradeable":{"code":"0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e523e02595067863309d7f7eca1e1e795e71e44f7a6c74c2f793a40e421f01ce64736f6c634300080d0033","runtime-code":"0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e523e02595067863309d7f7eca1e1e795e71e44f7a6c74c2f793a40e421f01ce64736f6c634300080d0033","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"3383:7122:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;3383:7122:0;;;;;;;;;;;;;;;;;","srcMapRuntime":"3383:7122:0:-:0;;;;;;;;","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Collection of functions related to the address type","kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Collection of functions related to the address type\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"AddressUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{}},"solidity/PetBridgeUpgradeable.sol:ContextUpgradeable":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"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.","kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"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.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"ContextUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{}},"solidity/PetBridgeUpgradeable.sol:IMessageBus":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[{"internalType":"uint256","name":"_dstChainId","type":"uint256"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"estimateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes","name":"_srcAddress","type":"bytes"},{"internalType":"address","name":"_dstAddress","type":"address"},{"internalType":"uint256","name":"_gasLimit","type":"uint256"},{"internalType":"uint256","name":"_nonce","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes32","name":"_messageId","type":"bytes32"}],"name":"executeMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_receiver","type":"bytes32"},{"internalType":"uint256","name":"_dstChainId","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_options","type":"bytes"}],"name":"sendMessage","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"estimateFee(uint256,bytes)":{"notice":"Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit"},"executeMessage(uint256,bytes,address,uint256,uint256,bytes,bytes32)":{"notice":"Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain"},"sendMessage(bytes32,uint256,bytes,bytes)":{"notice":"Sends a message to a receiving contract address on another chain. Sender must make sure that the message is unique and not a duplicate message."},"withdrawFee(address)":{"notice":"Withdraws message fee in the form of native gas token."}},"version":1},"developerDoc":{"kind":"dev","methods":{"estimateFee(uint256,bytes)":{"params":{"_options":"Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with."}},"executeMessage(uint256,bytes,address,uint256,uint256,bytes,bytes32)":{"params":{"_dstAddress":"Destination address that the arbitrary message will be passed to","_gasLimit":"Gas limit to be passed alongside the message, depending on the fee paid on srcChain","_message":"Arbitrary message payload to pass to the destination chain receiver","_messageId":"MessageId for uniqueness of messages (alongisde nonce)","_nonce":"Nonce from origin chain","_srcAddress":"Originating bytes address of the message sender on the srcChain","_srcChainId":"Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains"}},"sendMessage(bytes32,uint256,bytes,bytes)":{"params":{"_dstChainId":"The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains","_message":"The arbitrary payload to pass to the destination chain receiver","_options":"Versioned struct used to instruct relayer on how to proceed with gas limits","_receiver":"The bytes32 address of the destination contract to be called"}},"withdrawFee(address)":{"params":{"_account":"The address receiving the fee."}}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_dstChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_options\",\"type\":\"bytes\"}],\"name\":\"estimateFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_dstAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"_messageId\",\"type\":\"bytes32\"}],\"name\":\"executeMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_receiver\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_dstChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_options\",\"type\":\"bytes\"}],\"name\":\"sendMessage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"withdrawFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"estimateFee(uint256,bytes)\":{\"params\":{\"_options\":\"Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\"}},\"executeMessage(uint256,bytes,address,uint256,uint256,bytes,bytes32)\":{\"params\":{\"_dstAddress\":\"Destination address that the arbitrary message will be passed to\",\"_gasLimit\":\"Gas limit to be passed alongside the message, depending on the fee paid on srcChain\",\"_message\":\"Arbitrary message payload to pass to the destination chain receiver\",\"_messageId\":\"MessageId for uniqueness of messages (alongisde nonce)\",\"_nonce\":\"Nonce from origin chain\",\"_srcAddress\":\"Originating bytes address of the message sender on the srcChain\",\"_srcChainId\":\"Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\"}},\"sendMessage(bytes32,uint256,bytes,bytes)\":{\"params\":{\"_dstChainId\":\"The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\",\"_message\":\"The arbitrary payload to pass to the destination chain receiver\",\"_options\":\"Versioned struct used to instruct relayer on how to proceed with gas limits\",\"_receiver\":\"The bytes32 address of the destination contract to be called\"}},\"withdrawFee(address)\":{\"params\":{\"_account\":\"The address receiving the fee.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"estimateFee(uint256,bytes)\":{\"notice\":\"Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\"},\"executeMessage(uint256,bytes,address,uint256,uint256,bytes,bytes32)\":{\"notice\":\"Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\"},\"sendMessage(bytes32,uint256,bytes,bytes)\":{\"notice\":\"Sends a message to a receiving contract address on another chain. Sender must make sure that the message is unique and not a duplicate message.\"},\"withdrawFee(address)\":{\"notice\":\"Withdraws message fee in the form of native gas token.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"IMessageBus\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"estimateFee(uint256,bytes)":"5da6d2c4","executeMessage(uint256,bytes,address,uint256,uint256,bytes,bytes32)":"21730efc","sendMessage(bytes32,uint256,bytes,bytes)":"ac8a4c1b","withdrawFee(address)":"1ac3ddeb"}},"solidity/PetBridgeUpgradeable.sol:IPetCoreUpgradeable":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"bridgeMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getPet","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"originId","type":"uint8"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"season","type":"uint8"},{"internalType":"uint8","name":"eggType","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"},{"internalType":"uint8","name":"element","type":"uint8"},{"internalType":"uint8","name":"bonusCount","type":"uint8"},{"internalType":"uint8","name":"profBonus","type":"uint8"},{"internalType":"uint8","name":"profBonusScalar","type":"uint8"},{"internalType":"uint8","name":"craftBonus","type":"uint8"},{"internalType":"uint8","name":"craftBonusScalar","type":"uint8"},{"internalType":"uint8","name":"combatBonus","type":"uint8"},{"internalType":"uint8","name":"combatBonusScalar","type":"uint8"},{"internalType":"uint16","name":"appearance","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"shiny","type":"uint8"},{"internalType":"uint64","name":"hungryAt","type":"uint64"},{"internalType":"uint64","name":"equippableAt","type":"uint64"},{"internalType":"uint256","name":"equippedTo","type":"uint256"}],"internalType":"struct Pet","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"getUserPets","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"originId","type":"uint8"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"season","type":"uint8"},{"internalType":"uint8","name":"eggType","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"},{"internalType":"uint8","name":"element","type":"uint8"},{"internalType":"uint8","name":"bonusCount","type":"uint8"},{"internalType":"uint8","name":"profBonus","type":"uint8"},{"internalType":"uint8","name":"profBonusScalar","type":"uint8"},{"internalType":"uint8","name":"craftBonus","type":"uint8"},{"internalType":"uint8","name":"craftBonusScalar","type":"uint8"},{"internalType":"uint8","name":"combatBonus","type":"uint8"},{"internalType":"uint8","name":"combatBonusScalar","type":"uint8"},{"internalType":"uint16","name":"appearance","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"shiny","type":"uint8"},{"internalType":"uint64","name":"hungryAt","type":"uint64"},{"internalType":"uint64","name":"equippableAt","type":"uint64"},{"internalType":"uint256","name":"equippedTo","type":"uint256"}],"internalType":"struct Pet[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"originId","type":"uint8"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"season","type":"uint8"},{"internalType":"uint8","name":"eggType","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"},{"internalType":"uint8","name":"element","type":"uint8"},{"internalType":"uint8","name":"bonusCount","type":"uint8"},{"internalType":"uint8","name":"profBonus","type":"uint8"},{"internalType":"uint8","name":"profBonusScalar","type":"uint8"},{"internalType":"uint8","name":"craftBonus","type":"uint8"},{"internalType":"uint8","name":"craftBonusScalar","type":"uint8"},{"internalType":"uint8","name":"combatBonus","type":"uint8"},{"internalType":"uint8","name":"combatBonusScalar","type":"uint8"},{"internalType":"uint16","name":"appearance","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"shiny","type":"uint8"}],"internalType":"struct PetOptions","name":"_petOptions","type":"tuple"},{"internalType":"address","name":"owner","type":"address"}],"name":"hatchPet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"originId","type":"uint8"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"season","type":"uint8"},{"internalType":"uint8","name":"eggType","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"},{"internalType":"uint8","name":"element","type":"uint8"},{"internalType":"uint8","name":"bonusCount","type":"uint8"},{"internalType":"uint8","name":"profBonus","type":"uint8"},{"internalType":"uint8","name":"profBonusScalar","type":"uint8"},{"internalType":"uint8","name":"craftBonus","type":"uint8"},{"internalType":"uint8","name":"craftBonusScalar","type":"uint8"},{"internalType":"uint8","name":"combatBonus","type":"uint8"},{"internalType":"uint8","name":"combatBonusScalar","type":"uint8"},{"internalType":"uint16","name":"appearance","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"shiny","type":"uint8"},{"internalType":"uint64","name":"hungryAt","type":"uint64"},{"internalType":"uint64","name":"equippableAt","type":"uint64"},{"internalType":"uint256","name":"equippedTo","type":"uint256"}],"internalType":"struct Pet","name":"_pet","type":"tuple"}],"name":"updatePet","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"}],\"name\":\"bridgeMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"getPet\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"originId\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"season\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"eggType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"rarity\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"element\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"bonusCount\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"appearance\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"background\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"shiny\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"hungryAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"equippableAt\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"equippedTo\",\"type\":\"uint256\"}],\"internalType\":\"struct Pet\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"}],\"name\":\"getUserPets\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"originId\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"season\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"eggType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"rarity\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"element\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"bonusCount\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"appearance\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"background\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"shiny\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"hungryAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"equippableAt\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"equippedTo\",\"type\":\"uint256\"}],\"internalType\":\"struct Pet[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"originId\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"season\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"eggType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"rarity\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"element\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"bonusCount\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"appearance\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"background\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"shiny\",\"type\":\"uint8\"}],\"internalType\":\"struct PetOptions\",\"name\":\"_petOptions\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hatchPet\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"originId\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"season\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"eggType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"rarity\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"element\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"bonusCount\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"appearance\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"background\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"shiny\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"hungryAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"equippableAt\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"equippedTo\",\"type\":\"uint256\"}],\"internalType\":\"struct Pet\",\"name\":\"_pet\",\"type\":\"tuple\"}],\"name\":\"updatePet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"IPetCoreUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"approve(address,uint256)":"095ea7b3","bridgeMint(uint256,address)":"1b827671","getPet(uint256)":"59d55194","getUserPets(address)":"ba8cd532","hatchPet((uint8,string,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint16,uint8,uint8),address)":"2a4138d2","ownerOf(uint256)":"6352211e","safeTransferFrom(address,address,uint256)":"42842e0e","safeTransferFrom(address,address,uint256,bytes)":"b88d4fde","transferFrom(address,address,uint256)":"23b872dd","updatePet((uint256,uint8,string,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint16,uint8,uint8,uint64,uint64,uint256))":"f5882186"}},"solidity/PetBridgeUpgradeable.sol:ISynMessagingReceiver":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[{"internalType":"bytes32","name":"_srcAddress","type":"bytes32"},{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"}],"name":"executeMessage","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"notice":"Called by MessageBus"}},"version":1},"developerDoc":{"kind":"dev","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"details":"MUST be permissioned to trusted source apps via trustedRemote","params":{"_executor":"Address who called the MessageBus execution function","_message":"Arbitrary message bytes originated from and encoded by the source app contract","_srcAddress":"The bytes32 address of the source app contract","_srcChainId":"The source chain ID where the transfer is originated from"}}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"}],\"name\":\"executeMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"details\":\"MUST be permissioned to trusted source apps via trustedRemote\",\"params\":{\"_executor\":\"Address who called the MessageBus execution function\",\"_message\":\"Arbitrary message bytes originated from and encoded by the source app contract\",\"_srcAddress\":\"The bytes32 address of the source app contract\",\"_srcChainId\":\"The source chain ID where the transfer is originated from\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"notice\":\"Called by MessageBus\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"ISynMessagingReceiver\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"executeMessage(bytes32,uint256,bytes,address)":"a6060871"}},"solidity/PetBridgeUpgradeable.sol:Initializable":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"custom:oz-upgrades-unsafe-allow":"constructor constructor() initializer {} ``` ====","details":"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. 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] ```","kind":"dev","methods":{},"stateVariables":{"_initialized":{"details":"Indicates that the contract has been initialized."},"_initializing":{"details":"Indicates that the contract is in the process of being initialized."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor constructor() initializer {} ``` ====\",\"details\":\"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. 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] ```\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"_initialized\":{\"details\":\"Indicates that the contract has been initialized.\"},\"_initializing\":{\"details\":\"Indicates that the contract is in the process of being initialized.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"Initializable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{}},"solidity/PetBridgeUpgradeable.sol:OwnableUpgradeable":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"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.","kind":"dev","methods":{"owner()":{"details":"Returns the address of the current owner."},"renounceOwnership()":{"details":"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."},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"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.\",\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"OwnableUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"owner()":"8da5cb5b","renounceOwnership()":"715018a6","transferOwnership(address)":"f2fde38b"}},"solidity/PetBridgeUpgradeable.sol:PetBridgeUpgradeable":{"code":"0x608060405234801561001057600080fd5b50611ba6806100206000396000f3fe6080604052600436106100dd5760003560e01c8063a1a227fa1161007f578063bd3583ae11610059578063bd3583ae14610283578063c0e07f28146102a3578063f2fde38b146102b9578063f9ecc6f5146102d957600080fd5b8063a1a227fa14610223578063a606087114610250578063bb5e613b1461027057600080fd5b8063715018a6116100bb578063715018a61461015a57806384a12b0f1461016f5780638da5cb5b146101aa578063a1227b68146101f657600080fd5b8063485cc955146100e2578063547cad1214610104578063634d45b214610124575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611350565b6102f9565b005b34801561011057600080fd5b5061010261011f366004611389565b61045f565b34801561013057600080fd5b5061014461013f366004611494565b61050d565b60405161015191906116e8565b60405180910390f35b34801561016657600080fd5b506101026105d6565b34801561017b57600080fd5b5061019c61018a36600461173a565b60009081526066602052604090205490565b604051908152602001610151565b3480156101b657600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610151565b34801561020257600080fd5b506097546101d19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022f57600080fd5b506065546101d19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561025c57600080fd5b5061010261026b366004611753565b610649565b61010261027e3660046117ee565b610757565b34801561028f57600080fd5b5061010261029e3660046117ee565b610aaa565b3480156102af57600080fd5b5061019c60985481565b3480156102c557600080fd5b506101026102d4366004611389565b610b60565b3480156102e557600080fd5b506101026102f436600461173a565b610c5c565b600054610100900460ff166103145760005460ff1615610318565b303b155b61038f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600054610100900460ff161580156103ce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6103d6610cc8565b6065805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556097805492851692909116919091179055801561045a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b604080516102e081018252600060608083018281526080840183905260a084019190915260c0830182905260e08301829052610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e08301829052610200830182905261022083018290526102408301829052610260830182905261028083018290526102a083018290526102c08301829052825260208201819052918101919091526105d082610d4e565b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff16331461063d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b6106476000610e25565b565b60655473ffffffffffffffffffffffffffffffffffffffff1633146106b05760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206973206e6f74206d65737361676520627573000000000000006044820152606401610386565b600084815260666020526040902054851461070d5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736f757263652073656e64696e67206170700000000000006044820152606401610386565b610750858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250610e9c915050565b5050505050565b6097546040517f59d55194000000000000000000000000000000000000000000000000000000008152600481018490528391839160009173ffffffffffffffffffffffffffffffffffffffff16906359d5519490602401600060405180830381865afa1580156107cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526108119190810190611a29565b90508061026001516000146108685760405162461bcd60e51b815260206004820152600f60248201527f70657420697320657175697070656400000000000000000000000000000000006044820152606401610386565b60008281526066602052604081205490610883853385611165565b905060006108d1609854604080517e01000000000000000000000000000000000000000000000000000000000000602082015260228082019390935281518082039093018352604201905290565b6097546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810189905291925073ffffffffffffffffffffffffffffffffffffffff16906323b872dd90606401600060405180830381600087803b15801561094a57600080fd5b505af115801561095e573d6000803e3d6000fd5b50506097546040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a905230935073ffffffffffffffffffffffffffffffffffffffff9091169150636352211e90602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190611a5e565b73ffffffffffffffffffffffffffffffffffffffff1614610a5a5760405162461bcd60e51b815260206004820152601260248201527f4661696c656420746f206c6f636b2050657400000000000000000000000000006044820152606401610386565b610a66838684846111c6565b857f0158ec556cf37866a866d820878380a6a27533e8e17b9d692f800dd8de5ae84f86604051610a9891815260200190565b60405180910390a25050505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610b115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b60008281526066602090815260409182902083905581518481529081018390527f642e74356c0610a9f944fb1a2d88d2fb82c6b74921566eee8bc0f9bb30f74f03910160405180910390a15050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610bc75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b73ffffffffffffffffffffffffffffffffffffffff8116610c505760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610386565b610c5981610e25565b50565b60335473ffffffffffffffffffffffffffffffffffffffff163314610cc35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b609855565b600054610100900460ff16610d455760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610386565b61064733610e25565b604080516102e081018252600060608083018281526080840183905260a084019190915260c0830182905260e08301829052610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e08301829052610200830182905261022083018290526102408301829052610260830182905261028083018290526102a083018290526102c0830182905282526020820181905291810191909152600082806020019051810190610e1e9190611a7b565b9392505050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610ea783610d4e565b8051602082015160408084015160975491517f6352211e00000000000000000000000000000000000000000000000000000000815260048101829052949550929391929173ffffffffffffffffffffffffffffffffffffffff90911690636352211e90602401602060405180830381865afa925050508015610f64575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610f6191810190611a5e565b60015b610ff9576097546040517f1b8276710000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff848116602483015290911690631b82767190604401600060405180830381600087803b158015610fdc57600080fd5b505af1158015610ff0573d6000803e3d6000fd5b505050506110ab565b3073ffffffffffffffffffffffffffffffffffffffff8216036110a9576097546040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015260448201859052909116906342842e0e90606401600060405180830381600087803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b505050505b505b6097546040517ff588218600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063f588218690611101908690600401611b21565b600060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b50505050807f6bd58bb696941d116b542481b456cfc0a45988f5a1fca53066073374992d2f3746604051610a9891815260200190565b6060600060405180606001604052808481526020018573ffffffffffffffffffffffffffffffffffffffff168152602001868152509050806040516020016111ad91906116e8565b6040516020818303038152906040529150509392505050565b600083815260666020526040902054806112225760405162461bcd60e51b815260206004820152601f60248201527f4e6f2072656d6f7465206170702073657420666f722064737420636861696e006044820152606401610386565b8481146112975760405162461bcd60e51b815260206004820152602660248201527f5265636569766572206973206e6f7420696e20747275737465642072656d6f7460448201527f65206170707300000000000000000000000000000000000000000000000000006064820152608401610386565b6065546040517fac8a4c1b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063ac8a4c1b9034906112f5908990899089908990600401611b34565b6000604051808303818588803b15801561130e57600080fd5b505af1158015611322573d6000803e3d6000fd5b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c5957600080fd5b6000806040838503121561136357600080fd5b823561136e8161132e565b9150602083013561137e8161132e565b809150509250929050565b60006020828403121561139b57600080fd5b8135610e1e8161132e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610280810167ffffffffffffffff811182821017156113f9576113f96113a6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611446576114466113a6565b604052919050565b600067ffffffffffffffff821115611468576114686113a6565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b6000602082840312156114a657600080fd5b813567ffffffffffffffff8111156114bd57600080fd5b8201601f810184136114ce57600080fd5b80356114e16114dc8261144e565b6113ff565b8181528560208385010111156114f657600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b8381101561152f578181015183820152602001611517565b8381111561153e576000848401525b50505050565b6000815180845261155c816020860160208601611514565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006102808251845260208301516115ab602086018260ff169052565b5060408301518160408601526115c382860182611544565b91505060608301516115da606086018260ff169052565b5060808301516115ef608086018260ff169052565b5060a083015161160460a086018260ff169052565b5060c083015161161960c086018260ff169052565b5060e083015161162e60e086018260ff169052565b506101008381015160ff90811691860191909152610120808501518216908601526101408085015182169086015261016080850151821690860152610180808501518216908601526101a0808501518216908601526101c08085015161ffff16908601526101e08085015182169086015261020080850151909116908501526102208084015167ffffffffffffffff9081169186019190915261024080850151909116908501526102609283015192909301919091525090565b602081526000825160606020840152611704608084018261158e565b905073ffffffffffffffffffffffffffffffffffffffff6020850151166040840152604084015160608401528091505092915050565b60006020828403121561174c57600080fd5b5035919050565b60008060008060006080868803121561176b57600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561179157600080fd5b818801915088601f8301126117a557600080fd5b8135818111156117b457600080fd5b8960208285010111156117c657600080fd5b60208301955080945050505060608601356117e08161132e565b809150509295509295909350565b6000806040838503121561180157600080fd5b50508035926020909101359150565b805160ff8116811461182157600080fd5b919050565b600082601f83011261183757600080fd5b81516118456114dc8261144e565b81815284602083860101111561185a57600080fd5b61186b826020830160208701611514565b949350505050565b805161ffff8116811461182157600080fd5b805167ffffffffffffffff8116811461182157600080fd5b600061028082840312156118b057600080fd5b6118b86113d5565b9050815181526118ca60208301611810565b6020820152604082015167ffffffffffffffff8111156118e957600080fd5b6118f584828501611826565b60408301525061190760608301611810565b606082015261191860808301611810565b608082015261192960a08301611810565b60a082015261193a60c08301611810565b60c082015261194b60e08301611810565b60e082015261010061195e818401611810565b90820152610120611970838201611810565b90820152610140611982838201611810565b90820152610160611994838201611810565b908201526101806119a6838201611810565b908201526101a06119b8838201611810565b908201526101c06119ca838201611873565b908201526101e06119dc838201611810565b908201526102006119ee838201611810565b90820152610220611a00838201611885565b90820152610240611a12838201611885565b818301525061026080830151818301525092915050565b600060208284031215611a3b57600080fd5b815167ffffffffffffffff811115611a5257600080fd5b61186b8482850161189d565b600060208284031215611a7057600080fd5b8151610e1e8161132e565b600060208284031215611a8d57600080fd5b815167ffffffffffffffff80821115611aa557600080fd5b9083019060608286031215611ab957600080fd5b604051606081018181108382111715611ad457611ad46113a6565b604052825182811115611ae657600080fd5b611af28782860161189d565b82525060208301519150611b058261132e565b8160208201526040830151604082015280935050505092915050565b602081526000610e1e602083018461158e565b848152836020820152608060408201526000611b536080830185611544565b8281036060840152611b658185611544565b97965050505050505056fea26469706673582212207b7b9dbea5688d4c71a262b1fac7f585af4bdba4c0af18bd263923d8080dd2e264736f6c634300080d0033","runtime-code":"0x6080604052600436106100dd5760003560e01c8063a1a227fa1161007f578063bd3583ae11610059578063bd3583ae14610283578063c0e07f28146102a3578063f2fde38b146102b9578063f9ecc6f5146102d957600080fd5b8063a1a227fa14610223578063a606087114610250578063bb5e613b1461027057600080fd5b8063715018a6116100bb578063715018a61461015a57806384a12b0f1461016f5780638da5cb5b146101aa578063a1227b68146101f657600080fd5b8063485cc955146100e2578063547cad1214610104578063634d45b214610124575b600080fd5b3480156100ee57600080fd5b506101026100fd366004611350565b6102f9565b005b34801561011057600080fd5b5061010261011f366004611389565b61045f565b34801561013057600080fd5b5061014461013f366004611494565b61050d565b60405161015191906116e8565b60405180910390f35b34801561016657600080fd5b506101026105d6565b34801561017b57600080fd5b5061019c61018a36600461173a565b60009081526066602052604090205490565b604051908152602001610151565b3480156101b657600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610151565b34801561020257600080fd5b506097546101d19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561022f57600080fd5b506065546101d19073ffffffffffffffffffffffffffffffffffffffff1681565b34801561025c57600080fd5b5061010261026b366004611753565b610649565b61010261027e3660046117ee565b610757565b34801561028f57600080fd5b5061010261029e3660046117ee565b610aaa565b3480156102af57600080fd5b5061019c60985481565b3480156102c557600080fd5b506101026102d4366004611389565b610b60565b3480156102e557600080fd5b506101026102f436600461173a565b610c5c565b600054610100900460ff166103145760005460ff1615610318565b303b155b61038f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600054610100900460ff161580156103ce57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6103d6610cc8565b6065805473ffffffffffffffffffffffffffffffffffffffff8086167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556097805492851692909116919091179055801561045a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b505050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104c65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b604080516102e081018252600060608083018281526080840183905260a084019190915260c0830182905260e08301829052610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e08301829052610200830182905261022083018290526102408301829052610260830182905261028083018290526102a083018290526102c08301829052825260208201819052918101919091526105d082610d4e565b92915050565b60335473ffffffffffffffffffffffffffffffffffffffff16331461063d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b6106476000610e25565b565b60655473ffffffffffffffffffffffffffffffffffffffff1633146106b05760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206973206e6f74206d65737361676520627573000000000000006044820152606401610386565b600084815260666020526040902054851461070d5760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420736f757263652073656e64696e67206170700000000000006044820152606401610386565b610750858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250879250610e9c915050565b5050505050565b6097546040517f59d55194000000000000000000000000000000000000000000000000000000008152600481018490528391839160009173ffffffffffffffffffffffffffffffffffffffff16906359d5519490602401600060405180830381865afa1580156107cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526108119190810190611a29565b90508061026001516000146108685760405162461bcd60e51b815260206004820152600f60248201527f70657420697320657175697070656400000000000000000000000000000000006044820152606401610386565b60008281526066602052604081205490610883853385611165565b905060006108d1609854604080517e01000000000000000000000000000000000000000000000000000000000000602082015260228082019390935281518082039093018352604201905290565b6097546040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810189905291925073ffffffffffffffffffffffffffffffffffffffff16906323b872dd90606401600060405180830381600087803b15801561094a57600080fd5b505af115801561095e573d6000803e3d6000fd5b50506097546040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018a905230935073ffffffffffffffffffffffffffffffffffffffff9091169150636352211e90602401602060405180830381865afa1580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f79190611a5e565b73ffffffffffffffffffffffffffffffffffffffff1614610a5a5760405162461bcd60e51b815260206004820152601260248201527f4661696c656420746f206c6f636b2050657400000000000000000000000000006044820152606401610386565b610a66838684846111c6565b857f0158ec556cf37866a866d820878380a6a27533e8e17b9d692f800dd8de5ae84f86604051610a9891815260200190565b60405180910390a25050505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610b115760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b60008281526066602090815260409182902083905581518481529081018390527f642e74356c0610a9f944fb1a2d88d2fb82c6b74921566eee8bc0f9bb30f74f03910160405180910390a15050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610bc75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b73ffffffffffffffffffffffffffffffffffffffff8116610c505760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610386565b610c5981610e25565b50565b60335473ffffffffffffffffffffffffffffffffffffffff163314610cc35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610386565b609855565b600054610100900460ff16610d455760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610386565b61064733610e25565b604080516102e081018252600060608083018281526080840183905260a084019190915260c0830182905260e08301829052610100830182905261012083018290526101408301829052610160830182905261018083018290526101a083018290526101c083018290526101e08301829052610200830182905261022083018290526102408301829052610260830182905261028083018290526102a083018290526102c0830182905282526020820181905291810191909152600082806020019051810190610e1e9190611a7b565b9392505050565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610ea783610d4e565b8051602082015160408084015160975491517f6352211e00000000000000000000000000000000000000000000000000000000815260048101829052949550929391929173ffffffffffffffffffffffffffffffffffffffff90911690636352211e90602401602060405180830381865afa925050508015610f64575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610f6191810190611a5e565b60015b610ff9576097546040517f1b8276710000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff848116602483015290911690631b82767190604401600060405180830381600087803b158015610fdc57600080fd5b505af1158015610ff0573d6000803e3d6000fd5b505050506110ab565b3073ffffffffffffffffffffffffffffffffffffffff8216036110a9576097546040517f42842e0e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015260448201859052909116906342842e0e90606401600060405180830381600087803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b505050505b505b6097546040517ff588218600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063f588218690611101908690600401611b21565b600060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b50505050807f6bd58bb696941d116b542481b456cfc0a45988f5a1fca53066073374992d2f3746604051610a9891815260200190565b6060600060405180606001604052808481526020018573ffffffffffffffffffffffffffffffffffffffff168152602001868152509050806040516020016111ad91906116e8565b6040516020818303038152906040529150509392505050565b600083815260666020526040902054806112225760405162461bcd60e51b815260206004820152601f60248201527f4e6f2072656d6f7465206170702073657420666f722064737420636861696e006044820152606401610386565b8481146112975760405162461bcd60e51b815260206004820152602660248201527f5265636569766572206973206e6f7420696e20747275737465642072656d6f7460448201527f65206170707300000000000000000000000000000000000000000000000000006064820152608401610386565b6065546040517fac8a4c1b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063ac8a4c1b9034906112f5908990899089908990600401611b34565b6000604051808303818588803b15801561130e57600080fd5b505af1158015611322573d6000803e3d6000fd5b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c5957600080fd5b6000806040838503121561136357600080fd5b823561136e8161132e565b9150602083013561137e8161132e565b809150509250929050565b60006020828403121561139b57600080fd5b8135610e1e8161132e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610280810167ffffffffffffffff811182821017156113f9576113f96113a6565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715611446576114466113a6565b604052919050565b600067ffffffffffffffff821115611468576114686113a6565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b6000602082840312156114a657600080fd5b813567ffffffffffffffff8111156114bd57600080fd5b8201601f810184136114ce57600080fd5b80356114e16114dc8261144e565b6113ff565b8181528560208385010111156114f657600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b8381101561152f578181015183820152602001611517565b8381111561153e576000848401525b50505050565b6000815180845261155c816020860160208601611514565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006102808251845260208301516115ab602086018260ff169052565b5060408301518160408601526115c382860182611544565b91505060608301516115da606086018260ff169052565b5060808301516115ef608086018260ff169052565b5060a083015161160460a086018260ff169052565b5060c083015161161960c086018260ff169052565b5060e083015161162e60e086018260ff169052565b506101008381015160ff90811691860191909152610120808501518216908601526101408085015182169086015261016080850151821690860152610180808501518216908601526101a0808501518216908601526101c08085015161ffff16908601526101e08085015182169086015261020080850151909116908501526102208084015167ffffffffffffffff9081169186019190915261024080850151909116908501526102609283015192909301919091525090565b602081526000825160606020840152611704608084018261158e565b905073ffffffffffffffffffffffffffffffffffffffff6020850151166040840152604084015160608401528091505092915050565b60006020828403121561174c57600080fd5b5035919050565b60008060008060006080868803121561176b57600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561179157600080fd5b818801915088601f8301126117a557600080fd5b8135818111156117b457600080fd5b8960208285010111156117c657600080fd5b60208301955080945050505060608601356117e08161132e565b809150509295509295909350565b6000806040838503121561180157600080fd5b50508035926020909101359150565b805160ff8116811461182157600080fd5b919050565b600082601f83011261183757600080fd5b81516118456114dc8261144e565b81815284602083860101111561185a57600080fd5b61186b826020830160208701611514565b949350505050565b805161ffff8116811461182157600080fd5b805167ffffffffffffffff8116811461182157600080fd5b600061028082840312156118b057600080fd5b6118b86113d5565b9050815181526118ca60208301611810565b6020820152604082015167ffffffffffffffff8111156118e957600080fd5b6118f584828501611826565b60408301525061190760608301611810565b606082015261191860808301611810565b608082015261192960a08301611810565b60a082015261193a60c08301611810565b60c082015261194b60e08301611810565b60e082015261010061195e818401611810565b90820152610120611970838201611810565b90820152610140611982838201611810565b90820152610160611994838201611810565b908201526101806119a6838201611810565b908201526101a06119b8838201611810565b908201526101c06119ca838201611873565b908201526101e06119dc838201611810565b908201526102006119ee838201611810565b90820152610220611a00838201611885565b90820152610240611a12838201611885565b818301525061026080830151818301525092915050565b600060208284031215611a3b57600080fd5b815167ffffffffffffffff811115611a5257600080fd5b61186b8482850161189d565b600060208284031215611a7057600080fd5b8151610e1e8161132e565b600060208284031215611a8d57600080fd5b815167ffffffffffffffff80821115611aa557600080fd5b9083019060608286031215611ab957600080fd5b604051606081018181108382111715611ad457611ad46113a6565b604052825182811115611ae657600080fd5b611af28782860161189d565b82525060208301519150611b058261132e565b8160208201526040830151604082015280935050505092915050565b602081526000610e1e602083018461158e565b848152836020820152608060408201526000611b536080830185611544565b8281036060840152611b658185611544565b97965050505050505056fea26469706673582212207b7b9dbea5688d4c71a262b1fac7f585af4bdba4c0af18bd263923d8080dd2e264736f6c634300080d0033","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"22713:5865:0:-:0;;;;;;;;;;;;;;;;;;;","srcMapRuntime":"22713:5865:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;22962:176;;;;;;;;;;-1:-1:-1;22962:176:0;;;;;:::i;:::-;;:::i;:::-;;19666:102;;;;;;;;;;-1:-1:-1;19666:102:0;;;;;:::i;:::-;;:::i;23937:139::-;;;;;;;;;;-1:-1:-1;23937:139:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;16580:101;;;;;;;;;;;;;:::i;20087:143::-;;;;;;;;;;-1:-1:-1;20087:143:0;;;;;:::i;:::-;20154:21;20194:29;;;:19;:29;;;;;;;20087:143;;;;6811:25:1;;;6799:2;6784:18;20087:143:0;6665:177:1;15948:85:0;;;;;;;;;;-1:-1:-1;16020:6:0;;;;15948:85;;;7023:42:1;7011:55;;;6993:74;;6981:2;6966:18;15948:85:0;6847:226:1;22799:19:0;;;;;;;;;;-1:-1:-1;22799:19:0;;;;;;;;17763:25;;;;;;;;;;-1:-1:-1;17763:25:0;;;;;;;;18523:522;;;;;;;;;;-1:-1:-1;18523:522:0;;;;;:::i;:::-;;:::i;24796:1072::-;;;;;;:::i;:::-;;:::i;19847:207::-;;;;;;;;;;-1:-1:-1;19847:207:0;;;;;:::i;:::-;;:::i;22824:26::-;;;;;;;;;;;;;;;;16830:198;;;;;;;;;;-1:-1:-1;16830:198:0;;;;;:::i;:::-;;:::i;28177:108::-;;;;;;;;;;-1:-1:-1;28177:108:0;;;;;:::i;:::-;;:::i;22962:176::-;12775:13;;;;;;;:48;;12811:12;;;;12810:13;12775:48;;;13553:4;4665:19;:23;12791:16;12767:107;;;;-1:-1:-1;;;12767:107:0;;8836:2:1;12767:107:0;;;8818:21:1;8875:2;8855:18;;;8848:30;8914:34;8894:18;;;8887:62;8985:16;8965:18;;;8958:44;9019:19;;12767:107:0;;;;;;;;;12885:19;12908:13;;;;;;12907:14;12931:98;;;;12965:13;:20;;12999:19;;;;;;12931:98;23049:26:::1;:24;:26::i;:::-;23085:10;:24:::0;;::::1;::::0;;::::1;::::0;;;::::1;;::::0;;;23119:4:::1;:12:::0;;;;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;13051:66;;;;13101:5;13085:21;;;;;;13051:66;12486:637;22962:176;;:::o;19666:102::-;16020:6;;16160:23;16020:6;14401:10;16160:23;16152:68;;;;-1:-1:-1;;;16152:68:0;;9251:2:1;16152:68:0;;;9233:21:1;;;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9381:18;;16152:68:0;9049:356:1;16152:68:0;19737:10:::1;:24:::0;;;::::1;;::::0;;;::::1;::::0;;;::::1;::::0;;19666:102::o;23937:139::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24045:24:0;24060:8;24045:14;:24::i;:::-;24038:31;23937:139;-1:-1:-1;;23937:139:0:o;16580:101::-;16020:6;;16160:23;16020:6;14401:10;16160:23;16152:68;;;;-1:-1:-1;;;16152:68:0;;9251:2:1;16152:68:0;;;9233:21:1;;;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9381:18;;16152:68:0;9049:356:1;16152:68:0;16644:30:::1;16671:1;16644:18;:30::i;:::-;16580:101::o:0;18523:522::-;18780:10;;;;18766;:24;18758:62;;;;-1:-1:-1;;;18758:62:0;;9612:2:1;18758:62:0;;;9594:21:1;9651:2;9631:18;;;9624:30;9690:27;9670:18;;;9663:55;9735:18;;18758:62:0;9410:349:1;18758:62:0;18903:32;;;;:19;:32;;;;;;18888:47;;18880:86;;;;-1:-1:-1;;;18880:86:0;;9966:2:1;18880:86:0;;;9948:21:1;10005:2;9985:18;;;9978:30;10044:28;10024:18;;;10017:56;10090:18;;18880:86:0;9764:350:1;18880:86:0;18977:61;18992:11;19005;19018:8;;18977:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;19028:9:0;;-1:-1:-1;18977:14:0;;-1:-1:-1;;18977:61:0:i;:::-;18523:522;;;;;:::o;24796:1072::-;24996:4;;24976:39;;;;;;;;6811:25:1;;;24893:6:0;;24930:11;;24877:13;;24996:4;;;24976:32;;6784:18:1;;24976:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;24951:64;;25074:11;:22;;;25100:1;25074:27;25066:55;;;;-1:-1:-1;;;25066:55:0;;13747:2:1;25066:55:0;;;13729:21:1;13786:2;13766:18;;;13759:30;13825:17;13805:18;;;13798:45;13860:18;;25066:55:0;13545:339:1;25066:55:0;25132:16;25151:31;;;:19;:31;;;;;;;25402:46;25417:5;25424:10;25436:11;25402:14;:46::i;:::-;25377:71;;25485:20;25508:16;24190:11;;24162:40;;;17637:16:1;24162:40:0;;;17621:102:1;17739:11;;;;17732:27;;;;24162:40:0;;;;;;;;;;17775:12:1;;24162:40:0;;;24082:127;25508:16;25555:4;;25535:72;;;;;25574:10;25535:72;;;14152:34:1;25594:4:0;14202:18:1;;;14195:43;14254:18;;;14247:34;;;25485:39:0;;-1:-1:-1;25555:4:0;;;25535:38;;14064:18:1;;25535:72:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;25645:4:0;;25625:40;;;;;;;;6811:25:1;;;25677:4:0;;-1:-1:-1;25625:57:0;25645:4;;;;-1:-1:-1;25625:33:0;;6784:18:1;;25625:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:57;;;25617:88;;;;-1:-1:-1;;;25617:88:0;;14750:2:1;25617:88:0;;;14732:21:1;14789:2;14769:18;;;14762:30;14828:20;14808:18;;;14801:48;14866:18;;25617:88:0;14548:342:1;25617:88:0;25773:47;25779:8;25789:10;25801:9;25812:7;25773:5;:47::i;:::-;25843:5;25835:26;25850:10;25835:26;;;;6811:25:1;;6799:2;6784:18;;6665:177;25835:26:0;;;;;;;;24867:1001;;;;;;24796:1072;;:::o;19847:207::-;16020:6;;16160:23;16020:6;14401:10;16160:23;16152:68;;;;-1:-1:-1;;;16152:68:0;;9251:2:1;16152:68:0;;;9233:21:1;;;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9381:18;;16152:68:0;9049:356:1;16152:68:0;19944:32:::1;::::0;;;:19:::1;:32;::::0;;;;;;;;:46;;;20005:42;;15069:25:1;;;15110:18;;;15103:34;;;20005:42:0::1;::::0;15042:18:1;20005:42:0::1;;;;;;;19847:207:::0;;:::o;16830:198::-;16020:6;;16160:23;16020:6;14401:10;16160:23;16152:68;;;;-1:-1:-1;;;16152:68:0;;9251:2:1;16152:68:0;;;9233:21:1;;;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9381:18;;16152:68:0;9049:356:1;16152:68:0;16918:22:::1;::::0;::::1;16910:73;;;::::0;-1:-1:-1;;;16910:73:0;;15350:2:1;16910:73:0::1;::::0;::::1;15332:21:1::0;15389:2;15369:18;;;15362:30;15428:34;15408:18;;;15401:62;15499:8;15479:18;;;15472:36;15525:19;;16910:73:0::1;15148:402:1::0;16910:73:0::1;16993:28;17012:8;16993:18;:28::i;:::-;16830:198:::0;:::o;28177:108::-;16020:6;;16160:23;16020:6;14401:10;16160:23;16152:68;;;;-1:-1:-1;;;16152:68:0;;9251:2:1;16152:68:0;;;9233:21:1;;;9270:18;;;9263:30;9329:34;9309:18;;;9302:62;9381:18;;16152:68:0;9049:356:1;16152:68:0;28252:11:::1;:26:::0;28177:108::o;15761:111::-;13358:13;;;;;;;13350:69;;;;-1:-1:-1;;;13350:69:0;;15757:2:1;13350:69:0;;;15739:21:1;15796:2;15776:18;;;15769:30;15835:34;15815:18;;;15808:62;15906:13;15886:18;;;15879:41;15937:19;;13350:69:0;15555:407:1;13350:69:0;15833:32:::1;14401:10:::0;15833:18:::1;:32::i;23716:215::-:0;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23818:35:0;23867:8;23856:37;;;;;;;;;;;;:::i;:::-;23818:75;23716:215;-1:-1:-1;;;23716:215:0:o;17182:187::-;17274:6;;;;17290:17;;;;;;;;;;;17322:40;;17274:6;;;17290:17;17274:6;;17322:40;;17255:16;;17322:40;17245:124;17182:187;:::o;26018:1642::-;26482:30;26515:24;26530:8;26515:14;:24::i;:::-;26570:16;;26614:17;;;;26660:18;;;;;26756:4;;26736:43;;;;;;;;6811:25:1;;;26570:16:0;;-1:-1:-1;26570:16:0;;26614:17;;26660:18;26756:4;;;;;26736:33;;6784:18:1;;26736:43:0;;;;;;;;;;;;;;;;;;-1:-1:-1;26736:43:0;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;26732:655;;27341:4;;27321:55;;;;;;;;17089:25:1;;;27341:4:0;17150:55:1;;;17130:18;;;17123:83;27341:4:0;;;;27321:36;;17062:18:1;;27321:55:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26732:655;;;27049:4;27029:25;;;;27025:140;;27094:4;;27074:76;;;;;27125:4;27074:76;;;14152:34:1;27094:4:0;14222:15:1;;;14202:18;;;14195:43;14254:18;;;14247:34;;;27094:4:0;;;;27074:42;;14064:18:1;;27074:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27025:140;26780:395;26732:655;27542:4;;27522:43;;;;;27542:4;;;;;27522:35;;:43;;27558:6;;27522:43;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27629:8;27618:35;27639:13;27618:35;;;;6811:25:1;;6799:2;6784:18;;6665:177;23280:430:0;23423:12;23505:30;23538:127;;;;;;;;23604:12;23538:127;;;;23639:15;23538:127;;;;;;23576:6;23538:127;;;23505:160;;23693:9;23682:21;;;;;;;;:::i;:::-;;;;;;;;;;;;;23675:28;;;23280:430;;;;;:::o;27666:505::-;27833:21;27857:32;;;:19;:32;;;;;;;27899:71;;;;-1:-1:-1;;;27899:71:0;;18000:2:1;27899:71:0;;;17982:21:1;18039:2;18019:18;;;18012:30;18078:33;18058:18;;;18051:61;18129:18;;27899:71:0;17798:355:1;27899:71:0;28005:9;27988:13;:26;27980:77;;;;-1:-1:-1;;;27980:77:0;;18360:2:1;27980:77:0;;;18342:21:1;18399:2;18379:18;;;18372:30;18438:34;18418:18;;;18411:62;18509:8;18489:18;;;18482:36;18535:19;;27980:77:0;18158:402:1;27980:77:0;28079:10;;28067:97;;;;;28079:10;;;;;28067:35;;28110:9;;28067:97;;28121:9;;28132:11;;28145:8;;28155;;28067:97;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27823:348;27666:505;;;;:::o;14:154:1:-;100:42;93:5;89:54;82:5;79:65;69:93;;158:1;155;148:12;173:388;241:6;249;302:2;290:9;281:7;277:23;273:32;270:52;;;318:1;315;308:12;270:52;357:9;344:23;376:31;401:5;376:31;:::i;:::-;426:5;-1:-1:-1;483:2:1;468:18;;455:32;496:33;455:32;496:33;:::i;:::-;548:7;538:17;;;173:388;;;;;:::o;566:247::-;625:6;678:2;666:9;657:7;653:23;649:32;646:52;;;694:1;691;684:12;646:52;733:9;720:23;752:31;777:5;752:31;:::i;818:184::-;870:77;867:1;860:88;967:4;964:1;957:15;991:4;988:1;981:15;1007:255;1079:2;1073:9;1121:6;1109:19;;1158:18;1143:34;;1179:22;;;1140:62;1137:88;;;1205:18;;:::i;:::-;1241:2;1234:22;1007:255;:::o;1267:334::-;1338:2;1332:9;1394:2;1384:13;;1399:66;1380:86;1368:99;;1497:18;1482:34;;1518:22;;;1479:62;1476:88;;;1544:18;;:::i;:::-;1580:2;1573:22;1267:334;;-1:-1:-1;1267:334:1:o;1606:245::-;1654:4;1687:18;1679:6;1676:30;1673:56;;;1709:18;;:::i;:::-;-1:-1:-1;1766:2:1;1754:15;1771:66;1750:88;1840:4;1746:99;;1606:245::o;1856:671::-;1924:6;1977:2;1965:9;1956:7;1952:23;1948:32;1945:52;;;1993:1;1990;1983:12;1945:52;2033:9;2020:23;2066:18;2058:6;2055:30;2052:50;;;2098:1;2095;2088:12;2052:50;2121:22;;2174:4;2166:13;;2162:27;-1:-1:-1;2152:55:1;;2203:1;2200;2193:12;2152:55;2239:2;2226:16;2264:48;2280:31;2308:2;2280:31;:::i;:::-;2264:48;:::i;:::-;2335:2;2328:5;2321:17;2375:7;2370:2;2365;2361;2357:11;2353:20;2350:33;2347:53;;;2396:1;2393;2386:12;2347:53;2451:2;2446;2442;2438:11;2433:2;2426:5;2422:14;2409:45;2495:1;2474:14;;;2490:2;2470:23;2463:34;;;;2478:5;1856:671;-1:-1:-1;;;;1856:671:1:o;2612:258::-;2684:1;2694:113;2708:6;2705:1;2702:13;2694:113;;;2784:11;;;2778:18;2765:11;;;2758:39;2730:2;2723:10;2694:113;;;2825:6;2822:1;2819:13;2816:48;;;2860:1;2851:6;2846:3;2842:16;2835:27;2816:48;;2612:258;;;:::o;2875:317::-;2917:3;2955:5;2949:12;2982:6;2977:3;2970:19;2998:63;3054:6;3047:4;3042:3;3038:14;3031:4;3024:5;3020:16;2998:63;:::i;:::-;3106:2;3094:15;3111:66;3090:88;3081:98;;;;3181:4;3077:109;;2875:317;-1:-1:-1;;2875:317:1:o;3399:2519::-;3445:3;3473:6;3506:5;3500:12;3495:3;3488:25;3559:4;3552:5;3548:16;3542:23;3574:46;3614:4;3609:3;3605:14;3591:12;2599:4;2588:16;2576:29;;2532:75;3574:46;;3668:4;3661:5;3657:16;3651:23;3706:2;3699:4;3694:3;3690:14;3683:26;3730:47;3773:2;3768:3;3764:12;3748:14;3730:47;:::i;:::-;3718:59;;;3825:4;3818:5;3814:16;3808:23;3840:48;3882:4;3877:3;3873:14;3857;2599:4;2588:16;2576:29;;2532:75;3840:48;;3936:4;3929:5;3925:16;3919:23;3951:48;3993:4;3988:3;3984:14;3968;2599:4;2588:16;2576:29;;2532:75;3951:48;;4047:4;4040:5;4036:16;4030:23;4062:48;4104:4;4099:3;4095:14;4079;2599:4;2588:16;2576:29;;2532:75;4062:48;;4158:4;4151:5;4147:16;4141:23;4173:48;4215:4;4210:3;4206:14;4190;2599:4;2588:16;2576:29;;2532:75;4173:48;;4269:4;4262:5;4258:16;4252:23;4284:48;4326:4;4321:3;4317:14;4301;2599:4;2588:16;2576:29;;2532:75;4284:48;-1:-1:-1;4351:6:1;4394:14;;;4388:21;2599:4;2588:16;;;4451:12;;;2576:29;;;;4483:6;4526:14;;;4520:21;2588:16;;4583:12;;;2576:29;4615:6;4658:14;;;4652:21;2588:16;;4715:12;;;2576:29;4747:6;4791:14;;;4785:21;2588:16;;4849:12;;;2576:29;4881:6;4925:14;;;4919:21;2588:16;;4983:12;;;2576:29;5015:6;5059:14;;;5053:21;2588:16;;5117:12;;;2576:29;5149:6;5193:14;;;5187:21;3273:6;3262:18;5252:12;;;3250:31;5284:6;5328:14;;;5322:21;2588:16;;5386:12;;;2576:29;5419:6;5463:15;;;5457:22;2588:16;;;5522:13;;;2576:29;5556:6;5600:15;;;5594:22;3368:18;3357:30;;;5660:13;;;3345:43;;;;5694:6;5738:15;;;5732:22;3357:30;;;5798:13;;;3345:43;5832:6;5875:15;;;5869:22;5854:13;;;;5847:45;;;;-1:-1:-1;5854:13:1;3399:2519::o;5923:552::-;6112:2;6101:9;6094:21;6075:4;6150:6;6144:13;6193:4;6188:2;6177:9;6173:18;6166:32;6221:56;6272:3;6261:9;6257:19;6243:12;6221:56;:::i;:::-;6207:70;;6341:42;6335:2;6327:6;6323:15;6317:22;6313:71;6308:2;6297:9;6293:18;6286:99;6441:2;6433:6;6429:15;6423:22;6416:4;6405:9;6401:20;6394:52;6463:6;6455:14;;;5923:552;;;;:::o;6480:180::-;6539:6;6592:2;6580:9;6571:7;6567:23;6563:32;6560:52;;;6608:1;6605;6598:12;6560:52;-1:-1:-1;6631:23:1;;6480:180;-1:-1:-1;6480:180:1:o;7078:863::-;7175:6;7183;7191;7199;7207;7260:3;7248:9;7239:7;7235:23;7231:33;7228:53;;;7277:1;7274;7267:12;7228:53;7313:9;7300:23;7290:33;;7370:2;7359:9;7355:18;7342:32;7332:42;;7425:2;7414:9;7410:18;7397:32;7448:18;7489:2;7481:6;7478:14;7475:34;;;7505:1;7502;7495:12;7475:34;7543:6;7532:9;7528:22;7518:32;;7588:7;7581:4;7577:2;7573:13;7569:27;7559:55;;7610:1;7607;7600:12;7559:55;7650:2;7637:16;7676:2;7668:6;7665:14;7662:34;;;7692:1;7689;7682:12;7662:34;7737:7;7732:2;7723:6;7719:2;7715:15;7711:24;7708:37;7705:57;;;7758:1;7755;7748:12;7705:57;7789:2;7785;7781:11;7771:21;;7811:6;7801:16;;;;;7867:2;7856:9;7852:18;7839:32;7880:31;7905:5;7880:31;:::i;:::-;7930:5;7920:15;;;7078:863;;;;;;;;:::o;7946:248::-;8014:6;8022;8075:2;8063:9;8054:7;8050:23;8046:32;8043:52;;;8091:1;8088;8081:12;8043:52;-1:-1:-1;;8114:23:1;;;8184:2;8169:18;;;8156:32;;-1:-1:-1;7946:248:1:o;10119:160::-;10196:13;;10249:4;10238:16;;10228:27;;10218:55;;10269:1;10266;10259:12;10218:55;10119:160;;;:::o;10284:429::-;10338:5;10391:3;10384:4;10376:6;10372:17;10368:27;10358:55;;10409:1;10406;10399:12;10358:55;10438:6;10432:13;10469:48;10485:31;10513:2;10485:31;:::i;10469:48::-;10542:2;10533:7;10526:19;10588:3;10581:4;10576:2;10568:6;10564:15;10560:26;10557:35;10554:55;;;10605:1;10602;10595:12;10554:55;10618:64;10679:2;10672:4;10663:7;10659:18;10652:4;10644:6;10640:17;10618:64;:::i;:::-;10700:7;10284:429;-1:-1:-1;;;;10284:429:1:o;10718:163::-;10796:13;;10849:6;10838:18;;10828:29;;10818:57;;10871:1;10868;10861:12;10886:175;10964:13;;11017:18;11006:30;;10996:41;;10986:69;;11051:1;11048;11041:12;11066:2118;11127:5;11175:6;11163:9;11158:3;11154:19;11150:32;11147:52;;;11195:1;11192;11185:12;11147:52;11217:22;;:::i;:::-;11208:31;;11268:9;11262:16;11255:5;11248:31;11311:47;11354:2;11343:9;11339:18;11311:47;:::i;:::-;11306:2;11299:5;11295:14;11288:71;11403:2;11392:9;11388:18;11382:25;11430:18;11422:6;11419:30;11416:50;;;11462:1;11459;11452:12;11416:50;11498:57;11551:3;11542:6;11531:9;11527:22;11498:57;:::i;:::-;11493:2;11486:5;11482:14;11475:81;;11588:47;11631:2;11620:9;11616:18;11588:47;:::i;:::-;11583:2;11576:5;11572:14;11565:71;11669:48;11712:3;11701:9;11697:19;11669:48;:::i;:::-;11663:3;11656:5;11652:15;11645:73;11751:48;11794:3;11783:9;11779:19;11751:48;:::i;:::-;11745:3;11738:5;11734:15;11727:73;11833:48;11876:3;11865:9;11861:19;11833:48;:::i;:::-;11827:3;11820:5;11816:15;11809:73;11915:48;11958:3;11947:9;11943:19;11915:48;:::i;:::-;11909:3;11902:5;11898:15;11891:73;11983:3;12018:47;12061:2;12050:9;12046:18;12018:47;:::i;:::-;12002:14;;;11995:71;12085:3;12120:47;12148:18;;;12120:47;:::i;:::-;12104:14;;;12097:71;12187:3;12222:47;12250:18;;;12222:47;:::i;:::-;12206:14;;;12199:71;12289:3;12324:47;12352:18;;;12324:47;:::i;:::-;12308:14;;;12301:71;12391:3;12426:47;12454:18;;;12426:47;:::i;:::-;12410:14;;;12403:71;12493:3;12528:47;12556:18;;;12528:47;:::i;:::-;12512:14;;;12505:71;12595:3;12630:48;12659:18;;;12630:48;:::i;:::-;12614:14;;;12607:72;12698:3;12733:47;12761:18;;;12733:47;:::i;:::-;12717:14;;;12710:71;12800:3;12835:47;12863:18;;;12835:47;:::i;:::-;12819:14;;;12812:71;12903:3;12939:49;12968:19;;;12939:49;:::i;:::-;12922:15;;;12915:74;13009:3;13045:49;13074:19;;;13045:49;:::i;:::-;13039:3;13032:5;13028:15;13021:74;;13115:3;13172;13161:9;13157:19;13151:26;13145:3;13138:5;13134:15;13127:51;;11066:2118;;;;:::o;13189:351::-;13279:6;13332:2;13320:9;13311:7;13307:23;13303:32;13300:52;;;13348:1;13345;13338:12;13300:52;13381:9;13375:16;13414:18;13406:6;13403:30;13400:50;;;13446:1;13443;13436:12;13400:50;13469:65;13526:7;13517:6;13506:9;13502:22;13469:65;:::i;14292:251::-;14362:6;14415:2;14403:9;14394:7;14390:23;14386:32;14383:52;;;14431:1;14428;14421:12;14383:52;14463:9;14457:16;14482:31;14507:5;14482:31;:::i;15967:943::-;16067:6;16120:2;16108:9;16099:7;16095:23;16091:32;16088:52;;;16136:1;16133;16126:12;16088:52;16169:9;16163:16;16198:18;16239:2;16231:6;16228:14;16225:34;;;16255:1;16252;16245:12;16225:34;16278:22;;;;16334:4;16316:16;;;16312:27;16309:47;;;16352:1;16349;16342:12;16309:47;16385:2;16379:9;16427:4;16419:6;16415:17;16482:6;16470:10;16467:22;16462:2;16450:10;16447:18;16444:46;16441:72;;;16493:18;;:::i;:::-;16529:2;16522:22;16569:9;;16590:16;;;16587:36;;;16619:1;16616;16609:12;16587:36;16647:60;16699:7;16688:8;16684:2;16680:17;16647:60;:::i;:::-;16639:6;16632:76;;16744:2;16740;16736:11;16730:18;16717:31;;16757;16782:5;16757:31;:::i;:::-;16821:5;16816:2;16808:6;16804:15;16797:30;16874:2;16870;16866:11;16860:18;16855:2;16847:6;16843:15;16836:43;16898:6;16888:16;;;;;15967:943;;;;:::o;17217:244::-;17386:2;17375:9;17368:21;17349:4;17406:49;17451:2;17440:9;17436:18;17428:6;17406:49;:::i;18565:523::-;18814:6;18803:9;18796:25;18857:6;18852:2;18841:9;18837:18;18830:34;18900:3;18895:2;18884:9;18880:18;18873:31;18777:4;18927:46;18968:3;18957:9;18953:19;18945:6;18927:46;:::i;:::-;19021:9;19013:6;19009:22;19004:2;18993:9;18989:18;18982:50;19049:33;19075:6;19067;19049:33;:::i;:::-;19041:41;18565:523;-1:-1:-1;;;;;;;18565:523:1:o","abiDefinition":[{"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":true,"internalType":"uint256","name":"petId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"arrivalChainId","type":"uint256"}],"name":"PetArrived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"petId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"arrivalChainId","type":"uint256"}],"name":"PetSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_srcAddress","type":"bytes32"}],"name":"SetTrustedRemote","type":"event"},{"inputs":[{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"decodeMessage","outputs":[{"components":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint8","name":"originId","type":"uint8"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"season","type":"uint8"},{"internalType":"uint8","name":"eggType","type":"uint8"},{"internalType":"uint8","name":"rarity","type":"uint8"},{"internalType":"uint8","name":"element","type":"uint8"},{"internalType":"uint8","name":"bonusCount","type":"uint8"},{"internalType":"uint8","name":"profBonus","type":"uint8"},{"internalType":"uint8","name":"profBonusScalar","type":"uint8"},{"internalType":"uint8","name":"craftBonus","type":"uint8"},{"internalType":"uint8","name":"craftBonusScalar","type":"uint8"},{"internalType":"uint8","name":"combatBonus","type":"uint8"},{"internalType":"uint8","name":"combatBonusScalar","type":"uint8"},{"internalType":"uint16","name":"appearance","type":"uint16"},{"internalType":"uint8","name":"background","type":"uint8"},{"internalType":"uint8","name":"shiny","type":"uint8"},{"internalType":"uint64","name":"hungryAt","type":"uint64"},{"internalType":"uint64","name":"equippableAt","type":"uint64"},{"internalType":"uint256","name":"equippedTo","type":"uint256"}],"internalType":"struct Pet","name":"dstPet","type":"tuple"},{"internalType":"address","name":"dstUser","type":"address"},{"internalType":"uint256","name":"dstPetId","type":"uint256"}],"internalType":"struct PetBridgeUpgradeable.MessageFormat","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_srcAddress","type":"bytes32"},{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"}],"name":"executeMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"getTrustedRemote","outputs":[{"internalType":"bytes32","name":"trustedRemote","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_messageBus","type":"address"},{"internalType":"address","name":"_pets","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"messageBus","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"msgGasLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pets","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_petId","type":"uint256"},{"internalType":"uint256","name":"_dstChainId","type":"uint256"}],"name":"sendPet","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_messageBus","type":"address"}],"name":"setMessageBus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_msgGasLimit","type":"uint256"}],"name":"setMsgGasLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes32","name":"_srcAddress","type":"bytes32"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"notice":"Executes a message called by MessageBus (MessageBusReceiver)"},"sendPet(uint256,uint256)":{"notice":"User must have an existing pet minted to bridge it."}},"version":1},"developerDoc":{"kind":"dev","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"details":"Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp","params":{"_executor":"Address who called the MessageBus execution function","_message":"Arbitrary message bytes originated from and encoded by the source app contract","_srcAddress":"The bytes32 address of the source app contract","_srcChainId":"The source chain ID where the transfer is originated from"}},"owner()":{"details":"Returns the address of the current owner."},"renounceOwnership()":{"details":"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."},"sendPet(uint256,uint256)":{"details":"This function enforces the caller to receive the Pet being bridged to the same address on another chain.Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,and can receive ERC721s.","params":{"_dstChainId":"The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains","_petId":"specifics which pet msg.sender already holds and will transfer to the bridge contract"}},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"stateVariables":{"__gap":{"details":"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"}},"title":"Core app for handling cross chain messaging passing to bridge Pet NFTs","version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":true,\"internalType\":\"uint256\",\"name\":\"petId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"arrivalChainId\",\"type\":\"uint256\"}],\"name\":\"PetArrived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"petId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"arrivalChainId\",\"type\":\"uint256\"}],\"name\":\"PetSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"}],\"name\":\"decodeMessage\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"originId\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"season\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"eggType\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"rarity\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"element\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"bonusCount\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"profBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"craftBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonus\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"combatBonusScalar\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"appearance\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"background\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"shiny\",\"type\":\"uint8\"},{\"internalType\":\"uint64\",\"name\":\"hungryAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"equippableAt\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"equippedTo\",\"type\":\"uint256\"}],\"internalType\":\"struct Pet\",\"name\":\"dstPet\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"dstUser\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"dstPetId\",\"type\":\"uint256\"}],\"internalType\":\"struct PetBridgeUpgradeable.MessageFormat\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"}],\"name\":\"executeMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"getTrustedRemote\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"trustedRemote\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageBus\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_pets\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBus\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"msgGasLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pets\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_petId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_dstChainId\",\"type\":\"uint256\"}],\"name\":\"sendPet\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageBus\",\"type\":\"address\"}],\"name\":\"setMessageBus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_msgGasLimit\",\"type\":\"uint256\"}],\"name\":\"setMsgGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"details\":\"Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\",\"params\":{\"_executor\":\"Address who called the MessageBus execution function\",\"_message\":\"Arbitrary message bytes originated from and encoded by the source app contract\",\"_srcAddress\":\"The bytes32 address of the source app contract\",\"_srcChainId\":\"The source chain ID where the transfer is originated from\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"sendPet(uint256,uint256)\":{\"details\":\"This function enforces the caller to receive the Pet being bridged to the same address on another chain.Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,and can receive ERC721s.\",\"params\":{\"_dstChainId\":\"The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\",\"_petId\":\"specifics which pet msg.sender already holds and will transfer to the bridge contract\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"__gap\":{\"details\":\"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\"}},\"title\":\"Core app for handling cross chain messaging passing to bridge Pet NFTs\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"notice\":\"Executes a message called by MessageBus (MessageBusReceiver)\"},\"sendPet(uint256,uint256)\":{\"notice\":\"User must have an existing pet minted to bridge it.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"PetBridgeUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"decodeMessage(bytes)":"634d45b2","executeMessage(bytes32,uint256,bytes,address)":"a6060871","getTrustedRemote(uint256)":"84a12b0f","initialize(address,address)":"485cc955","messageBus()":"a1a227fa","msgGasLimit()":"c0e07f28","owner()":"8da5cb5b","pets()":"a1227b68","renounceOwnership()":"715018a6","sendPet(uint256,uint256)":"bb5e613b","setMessageBus(address)":"547cad12","setMsgGasLimit(uint256)":"f9ecc6f5","setTrustedRemote(uint256,bytes32)":"bd3583ae","transferOwnership(address)":"f2fde38b"}},"solidity/PetBridgeUpgradeable.sol:SynMessagingReceiverUpgradeable":{"code":"0x","runtime-code":"0x","info":{"source":"pragma solidity 0.8.13;\n\n\n//\ninterface ISynMessagingReceiver {\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    // mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    /**\n     * @notice Called by MessageBus\n     * @dev MUST be permissioned to trusted source apps via trustedRemote\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external;\n}\n\n//\ninterface IMessageBus {\n    /**\n     * @notice Sends a message to a receiving contract address on another chain.\n     * Sender must make sure that the message is unique and not a duplicate message.\n     * @param _receiver The bytes32 address of the destination contract to be called\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     * @param _message The arbitrary payload to pass to the destination chain receiver\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits\n     */\n    function sendMessage(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes calldata _message,\n        bytes calldata _options\n    ) external payable;\n\n    /**\n     * @notice Relayer executes messages through an authenticated method to the destination receiver based on the originating transaction on source chain\n     * @param _srcChainId Originating chain ID - typically a standard EVM chain ID, but may refer to a Synapse-specific chain ID on nonEVM chains\n     * @param _srcAddress Originating bytes address of the message sender on the srcChain\n     * @param _dstAddress Destination address that the arbitrary message will be passed to\n     * @param _gasLimit Gas limit to be passed alongside the message, depending on the fee paid on srcChain\n     * @param _nonce Nonce from origin chain\n     * @param _message Arbitrary message payload to pass to the destination chain receiver\n     * @param _messageId MessageId for uniqueness of messages (alongisde nonce)\n     */\n    function executeMessage(\n        uint256 _srcChainId,\n        bytes calldata _srcAddress,\n        address _dstAddress,\n        uint256 _gasLimit,\n        uint256 _nonce,\n        bytes calldata _message,\n        bytes32 _messageId\n    ) external;\n\n    /**\n     * @notice Returns srcGasToken fee to charge in wei for the cross-chain message based on the gas limit\n     * @param _options Versioned struct used to instruct relayer on how to proceed with gas limits. Contains data on gas limit to submit tx with.\n     */\n    function estimateFee(uint256 _dstChainId, bytes calldata _options) external returns (uint256);\n\n    /**\n     * @notice Withdraws message fee in the form of native gas token.\n     * @param _account The address receiving the fee.\n     */\n    function withdrawFee(address _account) external;\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length \u003e 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance \u003e= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance \u003e= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length \u003e 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n\n//\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     */\n    bool private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Modifier to protect an initializer function from being invoked twice.\n     */\n    modifier initializer() {\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n        // contract may have been reentered.\n        require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n        bool isTopLevelCall = !_initializing;\n        if (isTopLevelCall) {\n            _initializing = true;\n            _initialized = true;\n        }\n\n        _;\n\n        if (isTopLevelCall) {\n            _initializing = false;\n        }\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} modifier, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    function _isConstructor() private view returns (bool) {\n        return !AddressUpgradeable.isContract(address(this));\n    }\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n\n//\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    function __Ownable_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable_init_unchained() internal onlyInitializing {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n\n    /**\n     * This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n\n//\nabstract contract SynMessagingReceiverUpgradeable is ISynMessagingReceiver, OwnableUpgradeable {\n    address public messageBus;\n\n    // Maps chain ID to the bytes32 trusted addresses allowed to be source senders\n    mapping(uint256 =\u003e bytes32) internal trustedRemoteLookup;\n\n    event SetTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress);\n\n    /**\n     * @notice Executes a message called by MessageBus (MessageBusReceiver)\n     * @dev Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\n     * @param _srcAddress The bytes32 address of the source app contract\n     * @param _srcChainId The source chain ID where the transfer is originated from\n     * @param _message Arbitrary message bytes originated from and encoded by the source app contract\n     * @param _executor Address who called the MessageBus execution function\n     */\n    function executeMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes calldata _message,\n        address _executor\n    ) external {\n        // Must be called by the MessageBus/MessageBus for security\n        require(msg.sender == messageBus, \"caller is not message bus\");\n        // Must also be from a trusted source app\n        require(_srcAddress == trustedRemoteLookup[_srcChainId], \"Invalid source sending app\");\n\n        _handleMessage(_srcAddress, _srcChainId, _message, _executor);\n    }\n\n    // Logic here handling messsage contents\n    function _handleMessage(\n        bytes32 _srcAddress,\n        uint256 _srcChainId,\n        bytes memory _message,\n        address _executor\n    ) internal virtual;\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal virtual {\n        require(trustedRemoteLookup[_dstChainId] != bytes32(0), \"Receiver not trusted remote\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    //** Config Functions */\n    function setMessageBus(address _messageBus) public onlyOwner {\n        messageBus = _messageBus;\n    }\n\n    // allow owner to set trusted addresses allowed to be source senders\n    function setTrustedRemote(uint256 _srcChainId, bytes32 _srcAddress) external onlyOwner {\n        trustedRemoteLookup[_srcChainId] = _srcAddress;\n        emit SetTrustedRemote(_srcChainId, _srcAddress);\n    }\n\n    //** View functions */\n    function getTrustedRemote(uint256 _chainId) external view returns (bytes32 trustedRemote) {\n        return trustedRemoteLookup[_chainId];\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n\nstruct PriceTier {\n    uint8 jewelCost;\n    uint16 goldCost;\n    uint8 tearCost;\n    uint32 incubationTime;\n    uint16 shinyChance;\n}\n\nstruct Pet {\n    uint256 id;\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType; // 0 = blue, 1 = grey, 2 = green, 3 = yellow, 4 = gold\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n    uint64 hungryAt;\n    uint64 equippableAt;\n    uint256 equippedTo;\n}\n\nstruct PetOptions {\n    uint8 originId;\n    string name;\n    uint8 season;\n    uint8 eggType;\n    uint8 rarity;\n    uint8 element;\n    uint8 bonusCount;\n    uint8 profBonus;\n    uint8 profBonusScalar;\n    uint8 craftBonus;\n    uint8 craftBonusScalar;\n    uint8 combatBonus;\n    uint8 combatBonusScalar;\n    uint16 appearance;\n    uint8 background;\n    uint8 shiny;\n}\n\nstruct UnhatchedEgg {\n    uint256 id;\n    uint256 petId;\n    address owner;\n    uint8 eggType;\n    uint256 seedblock;\n    uint256 finishTime;\n    uint8 tier; // 0 = Small, 1 = Medium, 2 = Large\n}\n\n//\ninterface IPetCoreUpgradeable {\n    function getUserPets(address _address) external view returns (Pet[] memory);\n\n    function getPet(uint256 _id) external view returns (Pet memory);\n\n    function hatchPet(PetOptions memory _petOptions, address owner) external returns (uint256);\n\n    function updatePet(Pet memory _pet) external;\n\n    function bridgeMint(uint256 _id, address _to) external;\n\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes memory _data\n    ) external;\n\n    function ownerOf(uint256 tokenId) external view returns (address);\n\n    function approve(address to, uint256 tokenId) external;\n}\n\n//\n/** @title Core app for handling cross chain messaging passing to bridge Pet NFTs\n */\ncontract PetBridgeUpgradeable is Initializable, SynMessagingReceiverUpgradeable {\n    address public pets;\n    uint256 public msgGasLimit;\n\n    struct MessageFormat {\n        Pet dstPet;\n        address dstUser;\n        uint256 dstPetId;\n    }\n\n    function initialize(address _messageBus, address _pets) external initializer {\n        __Ownable_init_unchained();\n        messageBus = _messageBus;\n        pets = _pets;\n    }\n\n    event PetSent(uint256 indexed petId, uint256 arrivalChainId);\n    event PetArrived(uint256 indexed petId, uint256 arrivalChainId);\n\n    function _createMessage(\n        uint256 _petId,\n        address _dstUserAddress,\n        Pet memory _petToBridge\n    ) internal pure returns (bytes memory) {\n        // create the message here from the nested struct\n        MessageFormat memory msgFormat = MessageFormat({\n            dstPetId: _petId,\n            dstPet: _petToBridge,\n            dstUser: _dstUserAddress\n        });\n        return abi.encode(msgFormat);\n    }\n\n    function _decodeMessage(bytes memory _message) internal pure returns (MessageFormat memory) {\n        MessageFormat memory decodedMessage = abi.decode(_message, (MessageFormat));\n        return decodedMessage;\n    }\n\n    function decodeMessage(bytes memory _message) external pure returns (MessageFormat memory) {\n        return _decodeMessage(_message);\n    }\n\n    function _createOptions() internal view returns (bytes memory) {\n        return abi.encodePacked(uint16(1), msgGasLimit);\n    }\n\n    /**\n     * @notice User must have an existing pet minted to bridge it.\n     * @dev This function enforces the caller to receive the Pet being bridged to the same address on another chain.\n     * @dev Do NOT call this from other contracts, unless the contract is deployed on another chain to the same address,\n     * @dev and can receive ERC721s.\n     * @param _petId specifics which pet msg.sender already holds and will transfer to the bridge contract\n     * @param _dstChainId The destination chain ID - typically, standard EVM chain ID, but differs on nonEVM chains\n     */\n    function sendPet(uint256 _petId, uint256 _dstChainId) external payable {\n        uint256 petId = _petId;\n        uint256 dstChainId = _dstChainId;\n        Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(petId);\n        // revert if the pet is equipped\n        require(petToBridge.equippedTo == 0, \"pet is equipped\");\n\n        bytes32 receiver = trustedRemoteLookup[dstChainId];\n        // _createMessage(petId, dstUserAddress, Pet);\n        // Only bridgeable directly to the caller of this contract\n        // @dev do not call this function from other contracts\n        bytes memory msgToPass = _createMessage(petId, msg.sender, petToBridge);\n        // Create _options\n        bytes memory options = _createOptions();\n\n        IPetCoreUpgradeable(pets).transferFrom(msg.sender, address(this), petId);\n        require(IPetCoreUpgradeable(pets).ownerOf(petId) == address(this), \"Failed to lock Pet\");\n        // Pet now locked, message can be safely emitted\n\n        _send(receiver, dstChainId, msgToPass, options);\n        emit PetSent(petId, dstChainId);\n    }\n\n    // Function called by executeMessage() - handleMessage will handle the pet bridge mint\n    // executeMessage() handles permissioning checks\n    function _handleMessage(\n        bytes32,\n        uint256,\n        bytes memory _message,\n        address\n    ) internal override {\n        // Decode _message, depending on exactly how the originating message is structured\n        /**\n            Message data:\n                Pet memory petToBridge = IPetCoreUpgradeable(pets).getPet(_petId);\n                address dstUserAddress = msg.sender;\n                uint256 dstPetId = _petId;\n             */\n        MessageFormat memory passedMsg = _decodeMessage(_message);\n\n        Pet memory dstPet = passedMsg.dstPet;\n        address dstUser = passedMsg.dstUser;\n        uint256 dstPetId = passedMsg.dstPetId;\n\n        // will revert if non-existent Pet\n        try IPetCoreUpgradeable(pets).ownerOf(dstPetId) returns (address petOwner) {\n            /**\n                If petId does exist (which means it should be locked on this contract), as it was bridged before.\n                Transfer it to message.dstUserAddress\n                */\n\n            if (petOwner == address(this)) {\n                IPetCoreUpgradeable(pets).safeTransferFrom(address(this), dstUser, dstPetId);\n            }\n        } catch {\n            /**\n                If pet ID doesn't exist:\n                Mint a pet to msg.dstUserAddress\n                */\n            IPetCoreUpgradeable(pets).bridgeMint(dstPetId, dstUser);\n        }\n\n        // update the pet attributes based on the attributes in the message (Assumes the message has more recent attributes)\n        IPetCoreUpgradeable(pets).updatePet(dstPet);\n        // Tx completed, emit success\n        emit PetArrived(dstPetId, block.chainid);\n    }\n\n    function _send(\n        bytes32 _receiver,\n        uint256 _dstChainId,\n        bytes memory _message,\n        bytes memory _options\n    ) internal override {\n        bytes32 trustedRemote = trustedRemoteLookup[_dstChainId];\n        require(trustedRemote != bytes32(0), \"No remote app set for dst chain\");\n        require(trustedRemote == _receiver, \"Receiver is not in trusted remote apps\");\n        IMessageBus(messageBus).sendMessage{value: msg.value}(_receiver, _dstChainId, _message, _options);\n    }\n\n    function setMsgGasLimit(uint256 _msgGasLimit) external onlyOwner {\n        msgGasLimit = _msgGasLimit;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n","language":"Solidity","languageVersion":"0.8.13","compilerVersion":"0.8.13","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../","srcMap":"","srcMapRuntime":"","abiDefinition":[{"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":"uint256","name":"_srcChainId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"_srcAddress","type":"bytes32"}],"name":"SetTrustedRemote","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_srcAddress","type":"bytes32"},{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"}],"name":"executeMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_chainId","type":"uint256"}],"name":"getTrustedRemote","outputs":[{"internalType":"bytes32","name":"trustedRemote","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageBus","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_messageBus","type":"address"}],"name":"setMessageBus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_srcChainId","type":"uint256"},{"internalType":"bytes32","name":"_srcAddress","type":"bytes32"}],"name":"setTrustedRemote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"notice":"Executes a message called by MessageBus (MessageBusReceiver)"}},"version":1},"developerDoc":{"kind":"dev","methods":{"executeMessage(bytes32,uint256,bytes,address)":{"details":"Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp","params":{"_executor":"Address who called the MessageBus execution function","_message":"Arbitrary message bytes originated from and encoded by the source app contract","_srcAddress":"The bytes32 address of the source app contract","_srcChainId":"The source chain ID where the transfer is originated from"}},"owner()":{"details":"Returns the address of the current owner."},"renounceOwnership()":{"details":"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."},"transferOwnership(address)":{"details":"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."}},"stateVariables":{"__gap":{"details":"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"}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_message\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_executor\",\"type\":\"address\"}],\"name\":\"executeMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"getTrustedRemote\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"trustedRemote\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBus\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageBus\",\"type\":\"address\"}],\"name\":\"setMessageBus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_srcAddress\",\"type\":\"bytes32\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"details\":\"Must be called by MessageBug \u0026 sent from src chain by a trusted srcApp\",\"params\":{\"_executor\":\"Address who called the MessageBus execution function\",\"_message\":\"Arbitrary message bytes originated from and encoded by the source app contract\",\"_srcAddress\":\"The bytes32 address of the source app contract\",\"_srcChainId\":\"The source chain ID where the transfer is originated from\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"__gap\":{\"details\":\"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\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"executeMessage(bytes32,uint256,bytes,address)\":{\"notice\":\"Executes a message called by MessageBus (MessageBusReceiver)\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/PetBridgeUpgradeable.sol\":\"SynMessagingReceiverUpgradeable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/PetBridgeUpgradeable.sol\":{\"keccak256\":\"0xd69f8c698db524400b77a7561fad55abb99f068c10718d37a70a4718f758da98\",\"urls\":[\"bzz-raw://ae68f92427aa3eb69be5403c9c1f52f978ccf70882773cbc2c418e4e459b011d\",\"dweb:/ipfs/QmPWDBw3rLb3Q3Z3XPok1MF6T4U2GsTTy8Acy3BVKZZcqW\"]}},\"version\":1}"},"hashes":{"executeMessage(bytes32,uint256,bytes,address)":"a6060871","getTrustedRemote(uint256)":"84a12b0f","messageBus()":"a1a227fa","owner()":"8da5cb5b","renounceOwnership()":"715018a6","setMessageBus(address)":"547cad12","setTrustedRemote(uint256,bytes32)":"bd3583ae","transferOwnership(address)":"f2fde38b"}}}