ERC-20
Overview
Max Total Supply
26,899,480.869854 BONSAI
Holders
130
Total Transfers
-
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
BonsaiOFT
Compiler Version
v0.8.22-1.0.1
ZkSolc Version
v1.5.3
Optimization Enabled:
Yes with Mode 3
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.22; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {LibString} from "solady/utils/LibString.sol"; import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol"; import {DN404} from "dn404-adjustable/DN404.sol"; import {DN404Mirror} from "dn404-adjustable/DN404Mirror.sol"; import {OFTCore} from "@layerzerolabs/oft-evm/contracts/OFTCore.sol"; contract BonsaiOFT is DN404, OFTCore { string private _baseURI; DN404Mirror public mirror; constructor( uint96 _tokensPerNft, address _lzEndpoint, address _delegate ) OFTCore(decimals(), _lzEndpoint, _delegate) Ownable(_delegate) { mirror = new DN404Mirror(msg.sender); // not minting any tokens as the OG Bonsai contract already minted the entire supply _initializeDN404(0, address(0), address(mirror), _tokensPerNft); } function name() public pure override returns (string memory) { return "Bonsai Token"; } function symbol() public pure override returns (string memory) { return "BONSAI"; } function tokenURI(uint256 tokenId) public view override returns (string memory result) { if (bytes(_baseURI).length != 0) { result = string(abi.encodePacked(_baseURI, LibString.toString(tokenId), ".json")); } } function setBaseURI(string calldata baseURI_) public onlyOwner { _baseURI = baseURI_; } // OFT /** * @dev Retrieves the address of the underlying ERC20 implementation. * @return The address of the OFT token. * * @dev In the case of OFT, address(this) and erc20 are the same contract. */ function token() public view returns (address) { return address(this); } /** * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. * @return requiresApproval Needs approval of the underlying token implementation. * * @dev In the case of OFT where the contract IS the token, approval is NOT required. */ function approvalRequired() external pure virtual returns (bool) { return false; } /** * @dev Burns tokens from the sender's specified balance. * @param _from The address to debit the tokens from. * @param _amountLD The amount of tokens to send in local decimals. * @param _minAmountLD The minimum amount to send in local decimals. * @param _dstEid The destination chain ID. * @return amountSentLD The amount sent in local decimals. * @return amountReceivedLD The amount received in local decimals on the remote. */ function _debit( address _from, uint256 _amountLD, uint256 _minAmountLD, uint32 _dstEid ) internal virtual override returns (uint256 amountSentLD, uint256 amountReceivedLD) { (amountSentLD, amountReceivedLD) = _debitView(_amountLD, _minAmountLD, _dstEid); // @dev In NON-default OFT, amountSentLD could be 100, with a 10% fee, the amountReceivedLD amount is 90, // therefore amountSentLD CAN differ from amountReceivedLD. // @dev Default OFT burns on src. _burn(_from, amountSentLD); } /** * @dev Credits tokens to the specified address. * @param _to The address to credit the tokens to. * @param _amountLD The amount of tokens to credit in local decimals. * @dev _srcEid The source chain ID. * @return amountReceivedLD The amount of tokens ACTUALLY received in local decimals. */ function _credit( address _to, uint256 _amountLD, uint32 /*_srcEid*/ ) internal virtual override returns (uint256 amountReceivedLD) { if (_to == address(0x0)) _to = address(0xdead); // _mint(...) does not support address(0x0) // @dev Default OFT mints on dst. _mint(_to, _amountLD); // @dev In the case of NON-default OFT, the _amountLD MIGHT not be == amountReceivedLD. return _amountLD; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Library for converting numbers into strings and other string operations. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol) /// /// @dev Note: /// For performance and bytecode compactness, most of the string operations are restricted to /// byte strings (7-bit ASCII), except where otherwise specified. /// Usage of byte string operations on charsets with runes spanning two or more bytes /// can lead to undefined behavior. library LibString { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The length of the output is too small to contain all the hex digits. error HexLengthInsufficient(); /// @dev The length of the string is more than 32 bytes. error TooBigForSmallString(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The constant returned when the `search` is not found in the string. uint256 internal constant NOT_FOUND = type(uint256).max; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* DECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the base 10 decimal representation of `value`. function toString(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // The maximum value of a uint256 contains 78 digits (1 byte per digit), but // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. // We will need 1 word for the trailing zeros padding, 1 word for the length, // and 3 words for a maximum of 78 digits. str := add(mload(0x40), 0x80) // Update the free memory pointer to allocate. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end of the memory to calculate the length later. let end := str let w := not(0) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 1)`. // Write the character to the pointer. // The ASCII index of the '0' character is 48. mstore8(str, add(48, mod(temp, 10))) // Keep dividing `temp` until zero. temp := div(temp, 10) if iszero(temp) { break } } let length := sub(end, str) // Move the pointer 32 bytes leftwards to make room for the length. str := sub(str, 0x20) // Store the length. mstore(str, length) } } /// @dev Returns the base 10 decimal representation of `value`. function toString(int256 value) internal pure returns (string memory str) { if (value >= 0) { return toString(uint256(value)); } unchecked { str = toString(~uint256(value) + 1); } /// @solidity memory-safe-assembly assembly { // We still have some spare memory space on the left, // as we have allocated 3 words (96 bytes) for up to 78 digits. let length := mload(str) // Load the string length. mstore(str, 0x2d) // Store the '-' character. str := sub(str, 1) // Move back the string pointer by a byte. mstore(str, add(length, 1)) // Update the string length. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* HEXADECIMAL OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2 + 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexString(uint256 value, uint256 length) internal pure returns (string memory str) { str = toHexStringNoPrefix(value, length); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`, /// left-padded to an input length of `length` bytes. /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte, /// giving a total length of `length * 2` bytes. /// Reverts if `length` is too small for the output to contain all the digits. function toHexStringNoPrefix(uint256 value, uint256 length) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, `length * 2` bytes // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length. // We add 0x20 to the total and round down to a multiple of 0x20. // (0x20 + 0x20 + 0x02 + 0x20) = 0x62. str := add(mload(0x40), and(add(shl(1, length), 0x42), not(0x1f))) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let start := sub(str, add(length, length)) let w := not(1) // Tsk. let temp := value // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for {} 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(xor(str, start)) { break } } if temp { mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`. revert(0x1c, 0x04) } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2 + 2` bytes. function toHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x". /// The output excludes leading "0" from the `toHexString` output. /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`. function toMinimalHexString(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := add(mload(str), 2) // Compute the length. mstore(add(str, o), 0x3078) // Write the "0x" prefix, accounting for leading zero. str := sub(add(str, o), 2) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output excludes leading "0" from the `toHexStringNoPrefix` output. /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`. function toMinimalHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let o := eq(byte(0, mload(add(str, 0x20))), 0x30) // Whether leading zero is present. let strLength := mload(str) // Get the length. str := add(str, o) // Move the pointer, accounting for leading zero. mstore(str, sub(strLength, o)) // Write the length, accounting for leading zero. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. /// As address are 20 bytes long, the output will left-padded to have /// a length of `20 * 2` bytes. function toHexStringNoPrefix(uint256 value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x40 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0. str := add(mload(0x40), 0x80) // Allocate the memory. mstore(0x40, add(str, 0x20)) // Zeroize the slot after the string. mstore(str, 0) // Cache the end to calculate the length later. let end := str // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let w := not(1) // Tsk. // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let temp := value } 1 {} { str := add(str, w) // `sub(str, 2)`. mstore8(add(str, 1), mload(and(temp, 15))) mstore8(str, mload(and(shr(4, temp), 15))) temp := shr(8, temp) if iszero(temp) { break } } // Compute the string's length. let strLength := sub(end, str) // Move the pointer and write the length. str := sub(str, 0x20) mstore(str, strLength) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte, /// and the alphabets are capitalized conditionally according to /// https://eips.ethereum.org/EIPS/eip-55 function toHexStringChecksummed(address value) internal pure returns (string memory str) { str = toHexString(value); /// @solidity memory-safe-assembly assembly { let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...` let o := add(str, 0x22) let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... ` let t := shl(240, 136) // `0b10001000 << 240` for { let i := 0 } 1 {} { mstore(add(i, i), mul(t, byte(i, hashed))) i := add(i, 1) if eq(i, 20) { break } } mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask))))) o := add(o, 0x20) mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask))))) } } /// @dev Returns the hexadecimal representation of `value`. /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte. function toHexString(address value) internal pure returns (string memory str) { str = toHexStringNoPrefix(value); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hexadecimal representation of `value`. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(address value) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { str := mload(0x40) // Allocate the memory. // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length, // 0x02 bytes for the prefix, and 0x28 bytes for the digits. // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80. mstore(0x40, add(str, 0x80)) // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) str := add(str, 2) mstore(str, 40) let o := add(str, 0x20) mstore(add(o, 40), 0) value := shl(96, value) // We write the string from rightmost digit to leftmost digit. // The following is essentially a do-while loop that also handles the zero case. for { let i := 0 } 1 {} { let p := add(o, add(i, i)) let temp := byte(i, value) mstore8(add(p, 1), mload(and(temp, 15))) mstore8(p, mload(shr(4, temp))) i := add(i, 1) if eq(i, 20) { break } } } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexString(bytes memory raw) internal pure returns (string memory str) { str = toHexStringNoPrefix(raw); /// @solidity memory-safe-assembly assembly { let strLength := add(mload(str), 2) // Compute the length. mstore(str, 0x3078) // Write the "0x" prefix. str := sub(str, 2) // Move the pointer. mstore(str, strLength) // Write the length. } } /// @dev Returns the hex encoded string from the raw bytes. /// The output is encoded using 2 hexadecimal digits per byte. function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory str) { /// @solidity memory-safe-assembly assembly { let length := mload(raw) str := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix. mstore(str, add(length, length)) // Store the length of the output. // Store "0123456789abcdef" in scratch space. mstore(0x0f, 0x30313233343536373839616263646566) let o := add(str, 0x20) let end := add(raw, length) for {} iszero(eq(raw, end)) {} { raw := add(raw, 1) mstore8(add(o, 1), mload(and(mload(raw), 15))) mstore8(o, mload(and(shr(4, mload(raw)), 15))) o := add(o, 2) } mstore(o, 0) // Zeroize the slot after the string. mstore(0x40, add(o, 0x20)) // Allocate the memory. } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* RUNE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Returns the number of UTF characters in the string. function runeCount(string memory s) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { if mload(s) { mstore(0x00, div(not(0), 255)) mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506) let o := add(s, 0x20) let end := add(o, mload(s)) for { result := 1 } 1 { result := add(result, 1) } { o := add(o, byte(0, mload(shr(250, mload(o))))) if iszero(lt(o, end)) { break } } } } } /// @dev Returns if this string is a 7-bit ASCII string. /// (i.e. all characters codes are in [0..127]) function is7BitASCII(string memory s) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let mask := shl(7, div(not(0), 255)) result := 1 let n := mload(s) if n { let o := add(s, 0x20) let end := add(o, n) let last := mload(end) mstore(end, 0) for {} 1 {} { if and(mask, mload(o)) { result := 0 break } o := add(o, 0x20) if iszero(lt(o, end)) { break } } mstore(end, last) } } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* BYTE STRING OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // For performance and bytecode compactness, byte string operations are restricted // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets. // Usage of byte string operations on charsets with runes spanning two or more bytes // can lead to undefined behavior. /// @dev Returns `subject` all occurrences of `search` replaced with `replacement`. function replace(string memory subject, string memory search, string memory replacement) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) let replacementLength := mload(replacement) subject := add(subject, 0x20) search := add(search, 0x20) replacement := add(replacement, 0x20) result := add(mload(0x40), 0x20) let subjectEnd := add(subject, subjectLength) if iszero(gt(searchLength, subjectLength)) { let subjectSearchEnd := add(sub(subjectEnd, searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Copy the `replacement` one word at a time. for { let o := 0 } 1 {} { mstore(add(result, o), mload(add(replacement, o))) o := add(o, 0x20) if iszero(lt(o, replacementLength)) { break } } result := add(result, replacementLength) subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } mstore(result, t) result := add(result, 1) subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } } let resultRemainder := result result := add(mload(0x40), 0x20) let k := add(sub(resultRemainder, result), sub(subjectEnd, subject)) // Copy the rest of the string one word at a time. for {} lt(subject, subjectEnd) {} { mstore(resultRemainder, mload(subject)) resultRemainder := add(resultRemainder, 0x20) subject := add(subject, 0x20) } result := sub(result, 0x20) let last := add(add(result, 0x20), k) // Zeroize the slot after the string. mstore(last, 0) mstore(0x40, add(last, 0x20)) // Allocate the memory. mstore(result, k) // Store the length. } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for { let subjectLength := mload(subject) } 1 {} { if iszero(mload(search)) { if iszero(gt(from, subjectLength)) { result := from break } result := subjectLength break } let searchLength := mload(search) let subjectStart := add(subject, 0x20) result := not(0) // Initialize to `NOT_FOUND`. subject := add(subjectStart, from) let end := add(sub(add(subjectStart, subjectLength), searchLength), 1) let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(add(search, 0x20)) if iszero(and(lt(subject, end), lt(from, subjectLength))) { break } if iszero(lt(searchLength, 0x20)) { for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if iszero(shr(m, xor(mload(subject), s))) { if eq(keccak256(subject, searchLength), h) { result := sub(subject, subjectStart) break } } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } for {} 1 {} { if iszero(shr(m, xor(mload(subject), s))) { result := sub(subject, subjectStart) break } subject := add(subject, 1) if iszero(lt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from left to right. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function indexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = indexOf(subject, search, 0); } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left, starting from `from`. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search, uint256 from) internal pure returns (uint256 result) { /// @solidity memory-safe-assembly assembly { for {} 1 {} { result := not(0) // Initialize to `NOT_FOUND`. let searchLength := mload(search) if gt(searchLength, mload(subject)) { break } let w := result let fromMax := sub(mload(subject), searchLength) if iszero(gt(fromMax, from)) { from := fromMax } let end := add(add(subject, 0x20), w) subject := add(add(subject, 0x20), from) if iszero(gt(subject, end)) { break } // As this function is not too often used, // we shall simply use keccak256 for smaller bytecode size. for { let h := keccak256(add(search, 0x20), searchLength) } 1 {} { if eq(keccak256(subject, searchLength), h) { result := sub(subject, add(end, 1)) break } subject := add(subject, w) // `sub(subject, 1)`. if iszero(gt(subject, end)) { break } } break } } } /// @dev Returns the byte index of the first location of `search` in `subject`, /// searching from right to left. /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `search` is not found. function lastIndexOf(string memory subject, string memory search) internal pure returns (uint256 result) { result = lastIndexOf(subject, search, uint256(int256(-1))); } /// @dev Returns true if `search` is found in `subject`, false otherwise. function contains(string memory subject, string memory search) internal pure returns (bool) { return indexOf(subject, search) != NOT_FOUND; } /// @dev Returns whether `subject` starts with `search`. function startsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( iszero(gt(searchLength, mload(subject))), eq( keccak256(add(subject, 0x20), searchLength), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns whether `subject` ends with `search`. function endsWith(string memory subject, string memory search) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { let searchLength := mload(search) let subjectLength := mload(subject) // Whether `search` is not longer than `subject`. let withinRange := iszero(gt(searchLength, subjectLength)) // Just using keccak256 directly is actually cheaper. // forgefmt: disable-next-item result := and( withinRange, eq( keccak256( // `subject + 0x20 + max(subjectLength - searchLength, 0)`. add(add(subject, 0x20), mul(withinRange, sub(subjectLength, searchLength))), searchLength ), keccak256(add(search, 0x20), searchLength) ) ) } } /// @dev Returns `subject` repeated `times`. function repeat(string memory subject, uint256 times) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(or(iszero(times), iszero(subjectLength))) { subject := add(subject, 0x20) result := mload(0x40) let output := add(result, 0x20) for {} 1 {} { // Copy the `subject` one word at a time. for { let o := 0 } 1 {} { mstore(add(output, o), mload(add(subject, o))) o := add(o, 0x20) if iszero(lt(o, subjectLength)) { break } } output := add(output, subjectLength) times := sub(times, 1) if iszero(times) { break } } mstore(output, 0) // Zeroize the slot after the string. let resultLength := sub(output, add(result, 0x20)) mstore(result, resultLength) // Store the length. // Allocate the memory. mstore(0x40, add(result, add(resultLength, 0x20))) } } } /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive). /// `start` and `end` are byte offsets. function slice(string memory subject, uint256 start, uint256 end) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) if iszero(gt(subjectLength, end)) { end := subjectLength } if iszero(gt(subjectLength, start)) { start := subjectLength } if lt(start, end) { result := mload(0x40) let resultLength := sub(end, start) mstore(result, resultLength) subject := add(subject, start) let w := not(0x1f) // Copy the `subject` one word at a time, backwards. for { let o := and(add(resultLength, 0x1f), w) } 1 {} { mstore(add(result, o), mload(add(subject, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(result, 0x20), resultLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(result, and(add(resultLength, 0x3f), w))) } } } /// @dev Returns a copy of `subject` sliced from `start` to the end of the string. /// `start` is a byte offset. function slice(string memory subject, uint256 start) internal pure returns (string memory result) { result = slice(subject, start, uint256(int256(-1))); } /// @dev Returns all the indices of `search` in `subject`. /// The indices are byte offsets. function indicesOf(string memory subject, string memory search) internal pure returns (uint256[] memory result) { /// @solidity memory-safe-assembly assembly { let subjectLength := mload(subject) let searchLength := mload(search) if iszero(gt(searchLength, subjectLength)) { subject := add(subject, 0x20) search := add(search, 0x20) result := add(mload(0x40), 0x20) let subjectStart := subject let subjectSearchEnd := add(sub(add(subject, subjectLength), searchLength), 1) let h := 0 if iszero(lt(searchLength, 0x20)) { h := keccak256(search, searchLength) } let m := shl(3, sub(0x20, and(searchLength, 0x1f))) let s := mload(search) for {} 1 {} { let t := mload(subject) // Whether the first `searchLength % 32` bytes of // `subject` and `search` matches. if iszero(shr(m, xor(t, s))) { if h { if iszero(eq(keccak256(subject, searchLength), h)) { subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } continue } } // Append to `result`. mstore(result, sub(subject, subjectStart)) result := add(result, 0x20) // Advance `subject` by `searchLength`. subject := add(subject, searchLength) if searchLength { if iszero(lt(subject, subjectSearchEnd)) { break } continue } } subject := add(subject, 1) if iszero(lt(subject, subjectSearchEnd)) { break } } let resultEnd := result // Assign `result` to the free memory pointer. result := mload(0x40) // Store the length of `result`. mstore(result, shr(5, sub(resultEnd, add(result, 0x20)))) // Allocate memory for result. // We allocate one more word, so this array can be recycled for {split}. mstore(0x40, add(resultEnd, 0x20)) } } } /// @dev Returns a arrays of strings based on the `delimiter` inside of the `subject` string. function split(string memory subject, string memory delimiter) internal pure returns (string[] memory result) { uint256[] memory indices = indicesOf(subject, delimiter); /// @solidity memory-safe-assembly assembly { let w := not(0x1f) let indexPtr := add(indices, 0x20) let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1))) mstore(add(indicesEnd, w), mload(subject)) mstore(indices, add(mload(indices), 1)) let prevIndex := 0 for {} 1 {} { let index := mload(indexPtr) mstore(indexPtr, 0x60) if iszero(eq(index, prevIndex)) { let element := mload(0x40) let elementLength := sub(index, prevIndex) mstore(element, elementLength) // Copy the `subject` one word at a time, backwards. for { let o := and(add(elementLength, 0x1f), w) } 1 {} { mstore(add(element, o), mload(add(add(subject, prevIndex), o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } // Zeroize the slot after the string. mstore(add(add(element, 0x20), elementLength), 0) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, add(element, and(add(elementLength, 0x3f), w))) // Store the `element` into the array. mstore(indexPtr, element) } prevIndex := add(index, mload(delimiter)) indexPtr := add(indexPtr, 0x20) if iszero(lt(indexPtr, indicesEnd)) { break } } result := indices if iszero(mload(delimiter)) { result := add(indices, 0x20) mstore(result, sub(mload(indices), 2)) } } } /// @dev Returns a concatenated string of `a` and `b`. /// Cheaper than `string.concat()` and does not de-align the free memory pointer. function concat(string memory a, string memory b) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let w := not(0x1f) result := mload(0x40) let aLength := mload(a) // Copy `a` one word at a time, backwards. for { let o := and(add(aLength, 0x20), w) } 1 {} { mstore(add(result, o), mload(add(a, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let bLength := mload(b) let output := add(result, aLength) // Copy `b` one word at a time, backwards. for { let o := and(add(bLength, 0x20), w) } 1 {} { mstore(add(output, o), mload(add(b, o))) o := add(o, w) // `sub(o, 0x20)`. if iszero(o) { break } } let totalLength := add(aLength, bLength) let last := add(add(result, 0x20), totalLength) // Zeroize the slot after the string. mstore(last, 0) // Stores the length. mstore(result, totalLength) // Allocate memory for the length and the bytes, // rounded up to a multiple of 32. mstore(0x40, and(add(last, 0x1f), w)) } } /// @dev Returns a copy of the string in either lowercase or UPPERCASE. /// WARNING! This function is only compatible with 7-bit ASCII strings. function toCase(string memory subject, bool toUpper) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let length := mload(subject) if length { result := add(mload(0x40), 0x20) subject := add(subject, 1) let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff) let w := not(0) for { let o := length } 1 {} { o := add(o, w) let b := and(0xff, mload(add(subject, o))) mstore8(add(result, o), xor(b, and(shr(b, flags), 0x20))) if iszero(o) { break } } result := mload(0x40) mstore(result, length) // Store the length. let last := add(add(result, 0x20), length) mstore(last, 0) // Zeroize the slot after the string. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } } /// @dev Returns a string from a small bytes32 string. /// `s` must be null-terminated, or behavior will be undefined. function fromSmallString(bytes32 s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { result := mload(0x40) let n := 0 for {} byte(n, s) { n := add(n, 1) } {} // Scan for '\0'. mstore(result, n) let o := add(result, 0x20) mstore(o, s) mstore(add(o, n), 0) mstore(0x40, add(result, 0x40)) } } /// @dev Returns the small string, with all bytes after the first null byte zeroized. function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { for {} byte(result, s) { result := add(result, 1) } {} // Scan for '\0'. mstore(0x00, s) mstore(result, 0x00) result := mload(0x00) } } /// @dev Returns the string as a normalized null-terminated small string. function toSmallString(string memory s) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { result := mload(s) if iszero(lt(result, 33)) { mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`. revert(0x1c, 0x04) } result := shl(shl(3, sub(32, result)), mload(add(s, result))) } } /// @dev Returns a lowercased copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function lower(string memory subject) internal pure returns (string memory result) { result = toCase(subject, false); } /// @dev Returns an UPPERCASED copy of the string. /// WARNING! This function is only compatible with 7-bit ASCII strings. function upper(string memory subject) internal pure returns (string memory result) { result = toCase(subject, true); } /// @dev Escapes the string to be used within HTML tags. function escapeHTML(string memory s) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) // Store the bytes of the packed offsets and strides into the scratch space. // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6. mstore(0x1f, 0x900094) mstore(0x08, 0xc0000000a6ab) // Store ""&'<>" into the scratch space. mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) // Not in `["\"","'","&","<",">"]`. if iszero(and(shl(c, 1), 0x500000c400000000)) { mstore8(result, c) result := add(result, 1) continue } let t := shr(248, mload(c)) mstore(result, mload(and(t, 0x1f))) result := add(result, shr(5, t)) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes. function escapeJSON(string memory s, bool addDoubleQuotes) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { let end := add(s, mload(s)) result := add(mload(0x40), 0x20) if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } // Store "\\u0000" in scratch space. // Store "0123456789abcdef" in scratch space. // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`. // into the scratch space. mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672) // Bitmask for detecting `["\"","\\"]`. let e := or(shl(0x22, 1), shl(0x5c, 1)) for {} iszero(eq(s, end)) {} { s := add(s, 1) let c := and(mload(s), 0xff) if iszero(lt(c, 0x20)) { if iszero(and(shl(c, 1), e)) { // Not in `["\"","\\"]`. mstore8(result, c) result := add(result, 1) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), c) result := add(result, 2) continue } if iszero(and(shl(c, 1), 0x3700)) { // Not in `["\b","\t","\n","\f","\d"]`. mstore8(0x1d, mload(shr(4, c))) // Hex value. mstore8(0x1e, mload(and(c, 15))) // Hex value. mstore(result, mload(0x19)) // "\\u00XX". result := add(result, 6) continue } mstore8(result, 0x5c) // "\\". mstore8(add(result, 1), mload(add(c, 8))) result := add(result, 2) } if addDoubleQuotes { mstore8(result, 34) result := add(1, result) } let last := result mstore(last, 0) // Zeroize the slot after the string. result := mload(0x40) mstore(result, sub(last, add(result, 0x20))) // Store the length. mstore(0x40, add(last, 0x20)) // Allocate the memory. } } /// @dev Escapes the string to be used within double-quotes in a JSON. function escapeJSON(string memory s) internal pure returns (string memory result) { result = escapeJSON(s, false); } /// @dev Returns whether `a` equals `b`. function eq(string memory a, string memory b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b))) } } /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string. function eqs(string memory a, bytes32 b) internal pure returns (bool result) { /// @solidity memory-safe-assembly assembly { // These should be evaluated on compile time, as far as possible. let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`. let x := not(or(m, or(b, add(m, and(b, m))))) let r := shl(7, iszero(iszero(shr(128, x)))) r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x)))))) r := or(r, shl(5, lt(0xffffffff, shr(r, x)))) r := or(r, shl(4, lt(0xffff, shr(r, x)))) r := or(r, shl(3, lt(0xff, shr(r, x)))) // forgefmt: disable-next-item result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))), xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20))))) } } /// @dev Packs a single string with its length into a single word. /// Returns `bytes32(0)` if the length is zero or greater than 31. function packOne(string memory a) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { // We don't need to zero right pad the string, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes. mload(add(a, 0x1f)), // `length != 0 && length < 32`. Abuses underflow. // Assumes that the length is valid and within the block gas limit. lt(sub(mload(a), 1), 0x1f) ) } } /// @dev Unpacks a string packed using {packOne}. /// Returns the empty string if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packOne}, the output behavior is undefined. function unpackOne(bytes32 packed) internal pure returns (string memory result) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. result := mload(0x40) // Allocate 2 words (1 for the length, 1 for the bytes). mstore(0x40, add(result, 0x40)) // Zeroize the length slot. mstore(result, 0) // Store the length and bytes. mstore(add(result, 0x1f), packed) // Right pad with zeroes. mstore(add(add(result, 0x20), mload(result)), 0) } } /// @dev Packs two strings with their lengths into a single word. /// Returns `bytes32(0)` if combined length is zero or greater than 30. function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) { /// @solidity memory-safe-assembly assembly { let aLength := mload(a) // We don't need to zero right pad the strings, // since this is our own custom non-standard packing scheme. result := mul( // Load the length and the bytes of `a` and `b`. or( shl(shl(3, sub(0x1f, aLength)), mload(add(a, aLength))), mload(sub(add(b, 0x1e), aLength)) ), // `totalLength != 0 && totalLength < 31`. Abuses underflow. // Assumes that the lengths are valid and within the block gas limit. lt(sub(add(aLength, mload(b)), 1), 0x1e) ) } } /// @dev Unpacks strings packed using {packTwo}. /// Returns the empty strings if `packed` is `bytes32(0)`. /// If `packed` is not an output of {packTwo}, the output behavior is undefined. function unpackTwo(bytes32 packed) internal pure returns (string memory resultA, string memory resultB) { /// @solidity memory-safe-assembly assembly { // Grab the free memory pointer. resultA := mload(0x40) resultB := add(resultA, 0x40) // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words. mstore(0x40, add(resultB, 0x40)) // Zeroize the length slots. mstore(resultA, 0) mstore(resultB, 0) // Store the lengths and bytes. mstore(add(resultA, 0x1f), packed) mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA)))) // Right pad with zeroes. mstore(add(add(resultA, 0x20), mload(resultA)), 0) mstore(add(add(resultB, 0x20), mload(resultB)), 0) } } /// @dev Directly returns `a` without copying. function directReturn(string memory a) internal pure { assembly { // Assumes that the string does not start from the scratch space. let retStart := sub(a, 0x20) let retSize := add(mload(a), 0x40) // Right pad with zeroes. Just in case the string is produced // by a method that doesn't zero right pad. mstore(add(retStart, retSize), 0) // Store the return offset. mstore(retStart, 0x20) // End the transaction, returning the string. return(retStart, retSize) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol) /// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// /// @dev Note: /// - For ETH transfers, please use `forceSafeTransferETH` for DoS protection. /// - For ERC20s, this implementation won't check that a token has code, /// responsibility is delegated to the caller. library SafeTransferLib { /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CUSTOM ERRORS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev The ETH transfer has failed. error ETHTransferFailed(); /// @dev The ERC20 `transferFrom` has failed. error TransferFromFailed(); /// @dev The ERC20 `transfer` has failed. error TransferFailed(); /// @dev The ERC20 `approve` has failed. error ApproveFailed(); /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* CONSTANTS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Suggested gas stipend for contract receiving ETH that disallows any storage writes. uint256 internal constant GAS_STIPEND_NO_STORAGE_WRITES = 2300; /// @dev Suggested gas stipend for contract receiving ETH to perform a few /// storage reads and writes, but low enough to prevent griefing. uint256 internal constant GAS_STIPEND_NO_GRIEF = 100000; /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ETH OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ // If the ETH transfer MUST succeed with a reasonable gas budget, use the force variants. // // The regular variants: // - Forwards all remaining gas to the target. // - Reverts if the target reverts. // - Reverts if the current contract has insufficient balance. // // The force variants: // - Forwards with an optional gas stipend // (defaults to `GAS_STIPEND_NO_GRIEF`, which is sufficient for most cases). // - If the target reverts, or if the gas stipend is exhausted, // creates a temporary contract to force send the ETH via `SELFDESTRUCT`. // Future compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758. // - Reverts if the current contract has insufficient balance. // // The try variants: // - Forwards with a mandatory gas stipend. // - Instead of reverting, returns whether the transfer succeeded. /// @dev Sends `amount` (in wei) ETH to `to`. function safeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if iszero(call(gas(), to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Sends all the ETH in the current contract to `to`. function safeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // Transfer all the ETH and check if it succeeded or not. if iszero(call(gas(), to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero(call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with a `gasStipend`. function forceSafeTransferAllETH(address to, uint256 gasStipend) internal { /// @solidity memory-safe-assembly assembly { if iszero(call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends `amount` (in wei) ETH to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferETH(address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { if lt(selfbalance(), amount) { mstore(0x00, 0xb12d13eb) // `ETHTransferFailed()`. revert(0x1c, 0x04) } if iszero(call(GAS_STIPEND_NO_GRIEF, to, amount, codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(amount, 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Force sends all the ETH in the current contract to `to`, with `GAS_STIPEND_NO_GRIEF`. function forceSafeTransferAllETH(address to) internal { /// @solidity memory-safe-assembly assembly { // forgefmt: disable-next-item if iszero(call(GAS_STIPEND_NO_GRIEF, to, selfbalance(), codesize(), 0x00, codesize(), 0x00)) { mstore(0x00, to) // Store the address in scratch space. mstore8(0x0b, 0x73) // Opcode `PUSH20`. mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`. if iszero(create(selfbalance(), 0x0b, 0x16)) { revert(codesize(), codesize()) } // For gas estimation. } } } /// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`. function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call(gasStipend, to, amount, codesize(), 0x00, codesize(), 0x00) } } /// @dev Sends all the ETH in the current contract to `to`, with a `gasStipend`. function trySafeTransferAllETH(address to, uint256 gasStipend) internal returns (bool success) { /// @solidity memory-safe-assembly assembly { success := call(gasStipend, to, selfbalance(), codesize(), 0x00, codesize(), 0x00) } } /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/ /* ERC20 OPERATIONS */ /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/ /// @dev Sends `amount` of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have at least `amount` approved for /// the current contract to manage. function safeTransferFrom(address token, address from, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x60, amount) // Store the `amount` argument. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x23b872dd000000000000000000000000) // `transferFrom(address,address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends all of ERC20 `token` from `from` to `to`. /// Reverts upon failure. /// /// The `from` account must have their entire balance approved for /// the current contract to manage. function safeTransferAllFrom(address token, address from, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { let m := mload(0x40) // Cache the free memory pointer. mstore(0x40, to) // Store the `to` argument. mstore(0x2c, shl(96, from)) // Store the `from` argument. mstore(0x0c, 0x70a08231000000000000000000000000) // `balanceOf(address)`. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x00, 0x23b872dd) // `transferFrom(address,address,uint256)`. amount := mload(0x60) // The `amount` is already at 0x60. We'll need to return it. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20) ) ) { mstore(0x00, 0x7939f424) // `TransferFromFailed()`. revert(0x1c, 0x04) } mstore(0x60, 0) // Restore the zero slot to zero. mstore(0x40, m) // Restore the free memory pointer. } } /// @dev Sends `amount` of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransfer(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sends all of ERC20 `token` from the current contract to `to`. /// Reverts upon failure. function safeTransferAll(address token, address to) internal returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`. mstore(0x20, address()) // Store the address of the current contract. // Read the balance, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x14, to) // Store the `to` argument. amount := mload(0x34) // The `amount` is already at 0x34. We'll need to return it. mstore(0x00, 0xa9059cbb000000000000000000000000) // `transfer(address,uint256)`. // Perform the transfer, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x90b8ec18) // `TransferFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// Reverts upon failure. function safeApprove(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, reverting upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract. /// If the initial attempt to approve fails, attempts to reset the approved amount to zero, /// then retries the approval again (some tokens, e.g. USDT, requires this). /// Reverts upon failure. function safeApproveWithRetry(address token, address to, uint256 amount) internal { /// @solidity memory-safe-assembly assembly { mstore(0x14, to) // Store the `to` argument. mstore(0x34, amount) // Store the `amount` argument. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. // Perform the approval, retrying upon failure. if iszero( and( // The arguments of `and` are evaluated from right to left. or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x34, 0) // Store 0 for the `amount`. mstore(0x00, 0x095ea7b3000000000000000000000000) // `approve(address,uint256)`. pop(call(gas(), token, 0, 0x10, 0x44, codesize(), 0x00)) // Reset the approval. mstore(0x34, amount) // Store back the original `amount`. // Retry the approval, reverting upon failure. if iszero( and( or(eq(mload(0x00), 1), iszero(returndatasize())), // Returned 1 or nothing. call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20) ) ) { mstore(0x00, 0x3e3f8f73) // `ApproveFailed()`. revert(0x1c, 0x04) } } mstore(0x34, 0) // Restore the part of the free memory pointer that was overwritten. } } /// @dev Returns the amount of ERC20 `token` owned by `account`. /// Returns zero if the `token` does not exist. function balanceOf(address token, address account) internal view returns (uint256 amount) { /// @solidity memory-safe-assembly assembly { mstore(0x14, account) // Store the `account` argument. mstore(0x00, 0x70a08231000000000000000000000000) // `balanceOf(address)`. amount := mul( mload(0x20), and( // The arguments of `and` are evaluated from right to left. gt(returndatasize(), 0x1f), // At least 32 bytes returned. staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20) ) ) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title DN404 /// @notice DN404 is a hybrid ERC20 and ERC721 implementation that mints /// and burns NFTs based on an account's ERC20 token balance. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in this base DN404 contract, however a /// DN404Mirror contract ***MUST*** be deployed and linked during /// initialization. abstract contract DN404 { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when `amount` tokens is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 amount); /// @dev Emitted when `amount` tokens is approved by `owner` to be used by `spender`. event Approval(address indexed owner, address indexed spender, uint256 amount); /// @dev Emitted when `target` sets their skipNFT flag to `status`. event SkipNFTSet(address indexed target, bool status); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when the tokensPerNft is set to zero. error ZeroTokensPerNft(); /// @dev Thrown when attempting to double-initialize the contract. error DNAlreadyInitialized(); /// @dev Thrown when attempting to transfer or burn more tokens than sender's balance. error InsufficientBalance(); /// @dev Thrown when a spender attempts to transfer tokens with an insufficient allowance. error InsufficientAllowance(); /// @dev Thrown when minting an amount of tokens that would overflow the max tokens. error TotalSupplyOverflow(); /// @dev Thrown when the caller for a fallback NFT function is not the mirror contract. error SenderNotMirror(); /// @dev Thrown when attempting to transfer tokens to the zero address. error TransferToZeroAddress(); /// @dev Thrown when the mirror address provided for initialization is the zero address. error MirrorAddressIsZero(); /// @dev Thrown when the link call to the mirror contract reverts. error LinkMirrorContractFailed(); /// @dev Thrown when setting an NFT token approval /// and the caller is not the owner or an approved operator. error ApprovalCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT /// and the caller is not the owner or an approved operator. error TransferCallerNotOwnerNorApproved(); /// @dev Thrown when transferring an NFT and the from address is not the current owner. error TransferFromIncorrectOwner(); /// @dev Thrown when checking the owner or approved address for an non-existent NFT. error TokenDoesNotExist(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTANTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Amount of token balance that is equal to one NFT. /// @notice This is extended in this fork so that it is multiplied by tokensPerNft. /// This lets you have 18 decimals and multiple full tokens per NFT. uint256 internal immutable _WAD = 10 ** 18; /// @dev The maximum token ID allowed for an NFT. uint256 internal constant _MAX_TOKEN_ID = 0xffffffff; /// @dev The maximum possible token supply. uint256 internal constant _MAX_SUPPLY = 10 ** 18 * 0xffffffff - 1; /// @dev The flag to denote that the address data is initialized. uint8 internal constant _ADDRESS_DATA_INITIALIZED_FLAG = 1 << 0; /// @dev The flag to denote that the address should skip NFTs. uint8 internal constant _ADDRESS_DATA_SKIP_NFT_FLAG = 1 << 1; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing an address's token data and settings. struct AddressData { // Auxiliary data. uint88 aux; // Flags for `initialized` and `skipNFT`. uint8 flags; // The alias for the address. Zero means absence of an alias. uint32 addressAlias; // The number of NFT tokens. uint32 ownedLength; // The token balance in wei. uint96 balance; } /// @dev A uint32 map in storage. struct Uint32Map { mapping(uint256 => uint256) map; } /// @dev Struct containing the base token contract storage. struct DN404Storage { // Current number of address aliases assigned. uint32 numAliases; // Next token ID to assign for an NFT mint. uint32 nextTokenId; // Number of ERC20 tokens required to mint an NFT. uint96 tokensPerNft; // Total supply of minted NFTs. uint32 totalNFTSupply; // Total supply of tokens. uint96 totalSupply; // Address of the NFT mirror contract. address mirrorERC721; // Mapping of a user alias number to their address. mapping(uint32 => address) aliasToAddress; // Mapping of user operator approvals for NFTs. mapping(address => mapping(address => bool)) operatorApprovals; // Mapping of NFT token approvals to approved operators. mapping(uint256 => address) tokenApprovals; // Mapping of user allowances for token spenders. mapping(address => mapping(address => uint256)) allowance; // Mapping of NFT token IDs owned by an address. mapping(address => Uint32Map) owned; // Even indices: owner aliases. Odd indices: owned indices. Uint32Map oo; // Mapping of user account AddressData mapping(address => AddressData) addressData; } /// @dev Returns a storage pointer for DN404Storage. function _getDN404Storage() internal pure virtual returns (DN404Storage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_STORAGE")))`. $.slot := 0xa20d6e21d0e5255308 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INITIALIZER */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Initializes the DN404 contract with an /// `initialTokenSupply`, `initialTokenOwner` and `mirror` NFT contract address. function _initializeDN404( uint256 initialTokenSupply, address initialSupplyOwner, address mirror, uint96 tokensPerNft ) internal virtual { DN404Storage storage $ = _getDN404Storage(); if ($.nextTokenId != 0) revert DNAlreadyInitialized(); if (mirror == address(0)) revert MirrorAddressIsZero(); _linkMirrorContract(mirror); $.nextTokenId = 1; $.mirrorERC721 = mirror; if (tokensPerNft == 0) revert ZeroTokensPerNft(); $.tokensPerNft = tokensPerNft; if (initialTokenSupply > 0) { if (initialSupplyOwner == address(0)) revert TransferToZeroAddress(); if (initialTokenSupply > _MAX_SUPPLY) revert TotalSupplyOverflow(); $.totalSupply = uint96(initialTokenSupply); AddressData storage initialOwnerAddressData = _addressData(initialSupplyOwner); initialOwnerAddressData.balance = uint96(initialTokenSupply); emit Transfer(address(0), initialSupplyOwner, initialTokenSupply); _setSkipNFT(initialSupplyOwner, true); } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* METADATA FUNCTIONS TO OVERRIDE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the name of the token. function name() public view virtual returns (string memory); /// @dev Returns the symbol of the token. function symbol() public view virtual returns (string memory); /// @dev Returns the Uniform Resource Identifier (URI) for token `id`. function tokenURI(uint256 id) public view virtual returns (string memory); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC20 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the decimals places of the token. Always 18. function decimals() public pure returns (uint8) { return 18; } /// @dev Returns the amount of tokens in existence. function totalSupply() public view virtual returns (uint256) { return uint256(_getDN404Storage().totalSupply); } /// @dev Returns the amount of tokens owned by `owner`. function balanceOf(address owner) public view virtual returns (uint256) { return _getDN404Storage().addressData[owner].balance; } /// @dev Returns the amount of tokens that `spender` can spend on behalf of `owner`. function allowance(address owner, address spender) public view returns (uint256) { return _getDN404Storage().allowance[owner][spender]; } /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. /// /// Emits a {Approval} event. function approve(address spender, uint256 amount) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); $.allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @dev Transfer `amount` tokens from the caller to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// /// Emits a {Transfer} event. function transfer(address to, uint256 amount) public virtual returns (bool) { _transfer(msg.sender, to, amount); return true; } /// @dev Transfers `amount` tokens from `from` to `to`. /// /// Note: Does not update the allowance if it is the maximum uint256 value. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Requirements: /// - `from` must at least have `amount`. /// - The caller must have at least `amount` of allowance to transfer the tokens of `from`. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) { DN404Storage storage $ = _getDN404Storage(); uint256 allowed = $.allowance[from][msg.sender]; if (allowed != type(uint256).max) { if (amount > allowed) revert InsufficientAllowance(); unchecked { $.allowance[from][msg.sender] = allowed - amount; } } _transfer(from, to, amount); return true; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL MINT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Mints `amount` tokens to `to`, increasing the total supply. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _mint(address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage toAddressData = _addressData(to); unchecked { uint256 currentTokenSupply = uint256($.totalSupply) + amount; if (amount > _MAX_SUPPLY || currentTokenSupply > _MAX_SUPPLY) { revert TotalSupplyOverflow(); } $.totalSupply = uint96(currentTokenSupply); uint256 toBalance = toAddressData.balance + amount; toAddressData.balance = uint96(toBalance); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = toAddressData.ownedLength; uint256 toEnd = toBalance / ($.tokensPerNft * _WAD); _PackedLogs memory packedLogs = _packedLogsMalloc(_zeroFloorSub(toEnd, toIndex)); if (packedLogs.logs.length != 0) { uint256 maxNFTId = currentTokenSupply / ($.tokensPerNft * _WAD); uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(packedLogs.logs.length); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); _packedLogsSend(packedLogs, $.mirrorERC721); } } } emit Transfer(address(0), to, amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL BURN FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Burns `amount` tokens from `from`, reducing the total supply. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Emits a {Transfer} event. function _burn(address from, uint256 amount) internal virtual { DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); uint256 fromBalance = fromAddressData.balance; if (amount > fromBalance) revert InsufficientBalance(); uint256 currentTokenSupply = $.totalSupply; unchecked { fromBalance -= amount; fromAddressData.balance = uint96(fromBalance); currentTokenSupply -= amount; $.totalSupply = uint96(currentTokenSupply); Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = fromAddressData.ownedLength; uint256 nftAmountToBurn = _zeroFloorSub(fromIndex, fromBalance / ($.tokensPerNft * _WAD)); if (nftAmountToBurn != 0) { $.totalNFTSupply -= uint32(nftAmountToBurn); _PackedLogs memory packedLogs = _packedLogsMalloc(nftAmountToBurn); uint256 fromEnd = fromIndex - nftAmountToBurn; // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); fromAddressData.ownedLength = uint32(fromIndex); _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, address(0), amount); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* INTERNAL TRANSFER FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Moves `amount` of tokens from `from` to `to`. /// /// Will burn sender NFTs if balance after transfer is less than /// the amount required to support the current NFT balance. /// /// Will mint NFTs to `to` if the recipient's new balance supports /// additional NFTs ***AND*** the `to` address's skipNFT flag is /// set to false. /// /// Emits a {Transfer} event. function _transfer(address from, address to, uint256 amount) internal virtual { if (to == address(0)) revert TransferToZeroAddress(); DN404Storage storage $ = _getDN404Storage(); AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); _TransferTemps memory t; t.fromOwnedLength = fromAddressData.ownedLength; t.toOwnedLength = toAddressData.ownedLength; t.fromBalance = fromAddressData.balance; if (amount > t.fromBalance) revert InsufficientBalance(); unchecked { t.fromBalance -= amount; fromAddressData.balance = uint96(t.fromBalance); toAddressData.balance = uint96(t.toBalance = toAddressData.balance + amount); t.nftAmountToBurn = _zeroFloorSub(t.fromOwnedLength, t.fromBalance / ($.tokensPerNft * _WAD)); if (toAddressData.flags & _ADDRESS_DATA_SKIP_NFT_FLAG == 0) { if (from == to) t.toOwnedLength = t.fromOwnedLength - t.nftAmountToBurn; t.nftAmountToMint = _zeroFloorSub(t.toBalance / ($.tokensPerNft * _WAD), t.toOwnedLength); } _PackedLogs memory packedLogs = _packedLogsMalloc(t.nftAmountToBurn + t.nftAmountToMint); if (t.nftAmountToBurn != 0) { Uint32Map storage fromOwned = $.owned[from]; uint256 fromIndex = t.fromOwnedLength; uint256 fromEnd = fromIndex - t.nftAmountToBurn; $.totalNFTSupply -= uint32(t.nftAmountToBurn); fromAddressData.ownedLength = uint32(fromEnd); // Burn loop. do { uint256 id = _get(fromOwned, --fromIndex); _setOwnerAliasAndOwnedIndex($.oo, id, 0, 0); delete $.tokenApprovals[id]; _packedLogsAppend(packedLogs, from, id, 1); } while (fromIndex != fromEnd); } if (t.nftAmountToMint != 0) { Uint32Map storage toOwned = $.owned[to]; uint256 toIndex = t.toOwnedLength; uint256 toEnd = toIndex + t.nftAmountToMint; uint32 toAlias = _registerAndResolveAlias(toAddressData, to); uint256 maxNFTId = $.totalSupply / ($.tokensPerNft * _WAD); uint256 id = $.nextTokenId; $.totalNFTSupply += uint32(t.nftAmountToMint); toAddressData.ownedLength = uint32(toEnd); // Mint loop. do { while (_get($.oo, _ownershipIndex(id)) != 0) { if (++id > maxNFTId) id = 1; } _set(toOwned, toIndex, uint32(id)); _setOwnerAliasAndOwnedIndex($.oo, id, toAlias, uint32(toIndex++)); _packedLogsAppend(packedLogs, to, id, 0); if (++id > maxNFTId) id = 1; } while (toIndex != toEnd); $.nextTokenId = uint32(id); } if (packedLogs.logs.length != 0) { _packedLogsSend(packedLogs, $.mirrorERC721); } } emit Transfer(from, to, amount); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Call must originate from the mirror contract. /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// `msgSender` must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function _transferFromNFT(address from, address to, uint256 id, address msgSender) internal virtual { DN404Storage storage $ = _getDN404Storage(); if (to == address(0)) revert TransferToZeroAddress(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (from != owner) revert TransferFromIncorrectOwner(); if (msgSender != from) { if (!$.operatorApprovals[from][msgSender]) { if (msgSender != $.tokenApprovals[id]) { revert TransferCallerNotOwnerNorApproved(); } } } AddressData storage fromAddressData = _addressData(from); AddressData storage toAddressData = _addressData(to); fromAddressData.balance -= uint96($.tokensPerNft * _WAD); unchecked { toAddressData.balance += uint96($.tokensPerNft * _WAD); _set($.oo, _ownershipIndex(id), _registerAndResolveAlias(toAddressData, to)); delete $.tokenApprovals[id]; uint256 updatedId = _get($.owned[from], --fromAddressData.ownedLength); _set($.owned[from], _get($.oo, _ownedIndex(id)), uint32(updatedId)); uint256 n = toAddressData.ownedLength++; _set($.oo, _ownedIndex(updatedId), _get($.oo, _ownedIndex(id))); _set($.owned[to], n, uint32(id)); _set($.oo, _ownedIndex(id), uint32(n)); } emit Transfer(from, to, $.tokensPerNft * _WAD); } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* DATA HITCHHIKING FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the auxiliary data for `owner`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _getAux(address owner) internal view virtual returns (uint88) { return _getDN404Storage().addressData[owner].aux; } /// @dev Set the auxiliary data for `owner` to `value`. /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data. /// Auxiliary data can be set for any address, even if it does not have any tokens. function _setAux(address owner, uint88 value) internal virtual { _getDN404Storage().addressData[owner].aux = value; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* SKIP NFT FUNCTIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns true if account `a` will skip NFT minting on token mints and transfers. /// Returns false if account `a` will mint NFTs on token mints and transfers. function getSkipNFT(address a) public view virtual returns (bool) { AddressData storage d = _getDN404Storage().addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) return _hasCode(a); return d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0; } /// @dev Sets the caller's skipNFT flag to `skipNFT` /// /// Emits a {SkipNFTSet} event. function setSkipNFT(bool skipNFT) public virtual { _setSkipNFT(msg.sender, skipNFT); } /// @dev Internal function to set account `a` skipNFT flag to `state` /// /// Initializes account `a` AddressData if it is not currently initialized. /// /// Emits a {SkipNFTSet} event. function _setSkipNFT(address a, bool state) internal virtual { AddressData storage d = _addressData(a); if ((d.flags & _ADDRESS_DATA_SKIP_NFT_FLAG != 0) != state) { d.flags ^= _ADDRESS_DATA_SKIP_NFT_FLAG; } emit SkipNFTSet(a, state); } /// @dev Returns a storage data pointer for account `a` AddressData /// /// Initializes account `a` AddressData if it is not currently initialized. function _addressData(address a) internal virtual returns (AddressData storage d) { DN404Storage storage $ = _getDN404Storage(); d = $.addressData[a]; if (d.flags & _ADDRESS_DATA_INITIALIZED_FLAG == 0) { uint8 flags = _ADDRESS_DATA_INITIALIZED_FLAG; if (_hasCode(a)) flags |= _ADDRESS_DATA_SKIP_NFT_FLAG; d.flags = flags; } } /// @dev Returns the `addressAlias` of account `to`. /// /// Assigns and registers the next alias if `to` alias was not previously registered. function _registerAndResolveAlias(AddressData storage toAddressData, address to) internal virtual returns (uint32 addressAlias) { DN404Storage storage $ = _getDN404Storage(); addressAlias = toAddressData.addressAlias; if (addressAlias == 0) { addressAlias = ++$.numAliases; toAddressData.addressAlias = addressAlias; $.aliasToAddress[addressAlias] = to; } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the mirror NFT contract. function mirrorERC721() public view virtual returns (address) { return _getDN404Storage().mirrorERC721; } /// @dev Returns the total NFT supply. function _totalNFTSupply() internal view virtual returns (uint256) { return _getDN404Storage().totalNFTSupply; } /// @dev Returns `owner` NFT balance. function _balanceOfNFT(address owner) internal view virtual returns (uint256) { return _getDN404Storage().addressData[owner].ownedLength; } /// @dev Returns the owner of token `id`. /// Returns the zero address instead of reverting if the token does not exist. function _ownerAt(uint256 id) internal view virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); return $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; } /// @dev Returns the owner of token `id`. /// /// Requirements: /// - Token `id` must exist. function _ownerOf(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _ownerAt(id); } /// @dev Returns if token `id` exists. function _exists(uint256 id) internal view virtual returns (bool) { return _ownerAt(id) != address(0); } /// @dev Returns the account approved to manage token `id`. /// /// Requirements: /// - Token `id` must exist. function _getApproved(uint256 id) internal view virtual returns (address) { if (!_exists(id)) revert TokenDoesNotExist(); return _getDN404Storage().tokenApprovals[id]; } /// @dev Sets `spender` as the approved account to manage token `id`, using `msgSender`. /// /// Requirements: /// - `msgSender` must be the owner or an approved operator for the token owner. function _approveNFT(address spender, uint256 id, address msgSender) internal virtual returns (address) { DN404Storage storage $ = _getDN404Storage(); address owner = $.aliasToAddress[_get($.oo, _ownershipIndex(id))]; if (msgSender != owner) { if (!$.operatorApprovals[owner][msgSender]) { revert ApprovalCallerNotOwnerNorApproved(); } } $.tokenApprovals[id] = spender; return owner; } /// @dev Approve or remove the `operator` as an operator for `msgSender`, /// without authorization checks. function _setApprovalForAll(address operator, bool approved, address msgSender) internal virtual { _getDN404Storage().operatorApprovals[msgSender][operator] = approved; } /// @dev Calls the mirror contract to link it to this contract. /// /// Reverts if the call to the mirror contract reverts. function _linkMirrorContract(address mirror) internal virtual { /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x0f4599e5) // `linkMirrorContract(address)`. mstore(0x20, caller()) if iszero(and(eq(mload(0x00), 1), call(gas(), mirror, 0, 0x1c, 0x24, 0x00, 0x20))) { mstore(0x00, 0xd125259c) // `LinkMirrorContractFailed()`. revert(0x1c, 0x04) } } } /// @dev Fallback modifier to dispatch calls from the mirror NFT contract /// to internal functions in this contract. modifier dn404Fallback() virtual { DN404Storage storage $ = _getDN404Storage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `isApprovedForAll(address,address)`. if (fnSelector == 0xe985e9c5) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x44) revert(); address owner = address(uint160(_calldataload(0x04))); address operator = address(uint160(_calldataload(0x24))); _return($.operatorApprovals[owner][operator] ? 1 : 0); } // `ownerOf(uint256)`. if (fnSelector == 0x6352211e) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_ownerOf(id))); } // `transferFromNFT(address,address,uint256,address)`. if (fnSelector == 0xe5eb36c8) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x84) revert(); address from = address(uint160(_calldataload(0x04))); address to = address(uint160(_calldataload(0x24))); uint256 id = _calldataload(0x44); address msgSender = address(uint160(_calldataload(0x64))); _transferFromNFT(from, to, id, msgSender); _return(1); } // `setApprovalForAll(address,bool,address)`. if (fnSelector == 0x813500fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); bool status = _calldataload(0x24) != 0; address msgSender = address(uint160(_calldataload(0x44))); _setApprovalForAll(spender, status, msgSender); _return(1); } // `approveNFT(address,uint256,address)`. if (fnSelector == 0xd10b6e0c) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x64) revert(); address spender = address(uint160(_calldataload(0x04))); uint256 id = _calldataload(0x24); address msgSender = address(uint160(_calldataload(0x44))); _return(uint160(_approveNFT(spender, id, msgSender))); } // `getApproved(uint256)`. if (fnSelector == 0x081812fc) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); uint256 id = _calldataload(0x04); _return(uint160(_getApproved(id))); } // `balanceOfNFT(address)`. if (fnSelector == 0xf5b100ea) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x24) revert(); address owner = address(uint160(_calldataload(0x04))); _return(_balanceOfNFT(owner)); } // `totalNFTSupply()`. if (fnSelector == 0xe2c79281) { if (msg.sender != $.mirrorERC721) revert SenderNotMirror(); if (msg.data.length < 0x04) revert(); _return(_totalNFTSupply()); } // `implementsDN404()`. if (fnSelector == 0xb7a94eb8) { _return(1); } _; } /// @dev Fallback function for calls from mirror NFT contract. fallback() external payable virtual dn404Fallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct containing packed log data for `Transfer` events to be /// emitted by the mirror NFT contract. struct _PackedLogs { uint256[] logs; uint256 offset; } /// @dev Initiates memory allocation for packed logs with `n` log items. function _packedLogsMalloc(uint256 n) private pure returns (_PackedLogs memory p) { /// @solidity memory-safe-assembly assembly { let logs := add(mload(0x40), 0x40) // Offset by 2 words for `_packedLogsSend`. mstore(logs, n) let offset := add(0x20, logs) mstore(0x40, add(offset, shl(5, n))) mstore(p, logs) mstore(add(0x20, p), offset) } } /// @dev Adds a packed log item to `p` with address `a`, token `id` and burn flag `burnBit`. function _packedLogsAppend(_PackedLogs memory p, address a, uint256 id, uint256 burnBit) private pure { /// @solidity memory-safe-assembly assembly { let offset := mload(add(0x20, p)) mstore(offset, or(or(shl(96, a), shl(8, id)), burnBit)) mstore(add(0x20, p), add(offset, 0x20)) } } /// @dev Calls the `mirror` NFT contract to emit Transfer events for packed logs `p`. function _packedLogsSend(_PackedLogs memory p, address mirror) private { /// @solidity memory-safe-assembly assembly { let logs := mload(p) let o := sub(logs, 0x40) // Start of calldata to send. mstore(o, 0x263c69d6) // `logTransfer(uint256[])`. mstore(add(o, 0x20), 0x20) // Offset of `logs` in the calldata to send. let n := add(0x44, shl(5, mload(logs))) // Length of calldata to send. if iszero(and(eq(mload(o), 1), call(gas(), mirror, 0, add(o, 0x1c), n, o, 0x20))) { revert(o, 0x00) } } } /// @dev Struct of temporary variables for transfers. struct _TransferTemps { uint256 nftAmountToBurn; uint256 nftAmountToMint; uint256 fromBalance; uint256 toBalance; uint256 fromOwnedLength; uint256 toOwnedLength; } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Executes a return opcode to return `x` and end the current call frame. function _return(uint256 x) private pure { /// @solidity memory-safe-assembly assembly { mstore(0x00, x) return(0x00, 0x20) } } /// @dev Returns `max(0, x - y)`. function _zeroFloorSub(uint256 x, uint256 y) private pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { z := mul(gt(x, y), sub(x, y)) } } /// @dev Returns `i << 1`. function _ownershipIndex(uint256 i) private pure returns (uint256) { return i << 1; } /// @dev Returns `(i << 1) + 1`. function _ownedIndex(uint256 i) private pure returns (uint256) { unchecked { return (i << 1) + 1; } } /// @dev Returns the uint32 value at `index` in `map`. function _get(Uint32Map storage map, uint256 index) private view returns (uint32 result) { result = uint32(map.map[index >> 3] >> ((index & 7) << 5)); } /// @dev Updates the uint32 value at `index` in `map`. function _set(Uint32Map storage map, uint256 index, uint32 value) private { /// @solidity memory-safe-assembly assembly { mstore(0x20, map.slot) mstore(0x00, shr(3, index)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(5, and(index, 7)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } /// @dev Sets the owner alias and the owned index together. function _setOwnerAliasAndOwnedIndex( Uint32Map storage map, uint256 id, uint32 ownership, uint32 ownedIndex ) private { /// @solidity memory-safe-assembly assembly { let value := or(shl(32, ownedIndex), and(0xffffffff, ownership)) mstore(0x20, map.slot) mstore(0x00, shr(2, id)) let s := keccak256(0x00, 0x40) // Storage slot. let o := shl(6, and(id, 3)) // Storage slot offset (bits). let v := sload(s) // Storage slot value. let m := 0xffffffffffffffff // Value mask. sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value))))) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @title DN404Mirror /// @notice DN404Mirror provides an interface for interacting with the /// NFT tokens in a DN404 implementation. /// /// @author vectorized.eth (@optimizoor) /// @author Quit (@0xQuit) /// @author Michael Amadi (@AmadiMichaels) /// @author cygaar (@0xCygaar) /// @author Thomas (@0xjustadev) /// @author Harrison (@PopPunkOnChain) /// /// @dev Note: /// - The ERC721 data is stored in the base DN404 contract. contract DN404Mirror { /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* EVENTS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Emitted when token `id` is transferred from `from` to `to`. event Transfer(address indexed from, address indexed to, uint256 indexed id); /// @dev Emitted when `owner` enables `account` to manage the `id` token. event Approval(address indexed owner, address indexed account, uint256 indexed id); /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens. event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved); /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`. uint256 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`. uint256 private constant _APPROVAL_EVENT_SIGNATURE = 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925; /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`. uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE = 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31; /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CUSTOM ERRORS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Thrown when a call for an NFT function did not originate /// from the base DN404 contract. error SenderNotBase(); /// @dev Thrown when a call for an NFT function did not originate from the deployer. error SenderNotDeployer(); /// @dev Thrown when transferring an NFT to a contract address that /// does not implement ERC721Receiver. error TransferToNonERC721ReceiverImplementer(); /// @dev Thrown when linking to the DN404 base contract and the /// DN404 supportsInterface check fails or the call reverts. error CannotLink(); /// @dev Thrown when a linkMirrorContract call is received and the /// NFT mirror contract has already been linked to a DN404 base contract. error AlreadyLinked(); /// @dev Thrown when retrieving the base DN404 address when a link has not /// been established. error NotLinked(); /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* STORAGE */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Struct contain the NFT mirror contract storage. struct DN404NFTStorage { address baseERC20; address deployer; } /// @dev Returns a storage pointer for DN404NFTStorage. function _getDN404NFTStorage() internal pure virtual returns (DN404NFTStorage storage $) { /// @solidity memory-safe-assembly assembly { // `uint72(bytes9(keccak256("DN404_MIRROR_STORAGE")))`. $.slot := 0x3602298b8c10b01230 // Truncate to 9 bytes to reduce bytecode size. } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* CONSTRUCTOR */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ constructor(address deployer) { // For non-proxies, we will store the deployer so that only the deployer can // link the base contract. _getDN404NFTStorage().deployer = deployer; } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* ERC721 OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the token collection name from the base DN404 contract. function name() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x06fdde03) // `name()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the token collection symbol from the base DN404 contract. function symbol() public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x00, 0x95d89b41) // `symbol()`. if iszero(staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the Uniform Resource Identifier (URI) for token `id` from /// the base DN404 contract. function tokenURI(uint256 id) public view virtual returns (string memory result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { result := mload(0x40) mstore(0x20, id) mstore(0x00, 0xc87b56dd) // `tokenURI()`. if iszero(staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x00)) { returndatacopy(result, 0x00, returndatasize()) revert(result, returndatasize()) } returndatacopy(0x00, 0x00, 0x20) returndatacopy(result, mload(0x00), 0x20) returndatacopy(add(result, 0x20), add(mload(0x00), 0x20), mload(result)) mstore(0x40, add(add(result, 0x20), mload(result))) } } /// @dev Returns the total NFT supply from the base DN404 contract. function totalSupply() public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0xe2c79281) // `totalNFTSupply()`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x04, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the number of NFT tokens owned by `owner` from the base DN404 contract. /// /// Requirements: /// - `owner` must not be the zero address. function balanceOf(address owner) public view virtual returns (uint256 result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x20, shr(96, shl(96, owner))) mstore(0x00, 0xf5b100ea) // `balanceOfNFT(address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := mload(0x00) } } /// @dev Returns the owner of token `id` from the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function ownerOf(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x6352211e) // `ownerOf(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets `spender` as the approved account to manage token `id` in /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. /// - The caller must be the owner of the token, /// or an approved operator for the token owner. /// /// Emits an {Approval} event. function approve(address spender, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { spender := shr(96, shl(96, spender)) let m := mload(0x40) mstore(0x00, 0xd10b6e0c) // `approveNFT(address,uint256,address)`. mstore(0x20, spender) mstore(0x40, id) mstore(0x60, caller()) if iszero( and( gt(returndatasize(), 0x1f), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20) ) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. // Emit the {Approval} event. log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, shr(96, mload(0x0c)), spender, id) } } /// @dev Returns the account approved to manage token `id` from /// the base DN404 contract. /// /// Requirements: /// - Token `id` must exist. function getApproved(uint256 id) public view virtual returns (address result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x081812fc) // `getApproved(uint256)`. mstore(0x20, id) if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x24, 0x00, 0x20)) ) { returndatacopy(mload(0x40), 0x00, returndatasize()) revert(mload(0x40), returndatasize()) } result := shr(96, mload(0x0c)) } } /// @dev Sets whether `operator` is approved to manage the tokens of the caller in /// the base DN404 contract. /// /// Emits an {ApprovalForAll} event. function setApprovalForAll(address operator, bool approved) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { operator := shr(96, shl(96, operator)) let m := mload(0x40) mstore(0x00, 0x813500fc) // `setApprovalForAll(address,bool,address)`. mstore(0x20, operator) mstore(0x40, iszero(iszero(approved))) mstore(0x60, caller()) if iszero( and(eq(mload(0x00), 1), call(gas(), base, callvalue(), 0x1c, 0x64, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {ApprovalForAll} event. log3(0x40, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), operator) mstore(0x40, m) // Restore the free memory pointer. mstore(0x60, 0) // Restore the zero pointer. } } /// @dev Returns whether `operator` is approved to manage the tokens of `owner` from /// the base DN404 contract. function isApprovedForAll(address owner, address operator) public view virtual returns (bool result) { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { let m := mload(0x40) mstore(0x40, operator) mstore(0x2c, shl(96, owner)) mstore(0x0c, 0xe985e9c5000000000000000000000000) // `isApprovedForAll(address,address)`. if iszero( and(gt(returndatasize(), 0x1f), staticcall(gas(), base, 0x1c, 0x44, 0x00, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } mstore(0x40, m) // Restore the free memory pointer. result := iszero(iszero(mload(0x00))) } } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// /// Emits a {Transfer} event. function transferFrom(address from, address to, uint256 id) public virtual { address base = baseERC20(); /// @solidity memory-safe-assembly assembly { from := shr(96, shl(96, from)) to := shr(96, shl(96, to)) let m := mload(0x40) mstore(m, 0xe5eb36c8) // `transferFromNFT(address,address,uint256,address)`. mstore(add(m, 0x20), from) mstore(add(m, 0x40), to) mstore(add(m, 0x60), id) mstore(add(m, 0x80), caller()) if iszero( and(eq(mload(m), 1), call(gas(), base, callvalue(), add(m, 0x1c), 0x84, m, 0x20)) ) { returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } // Emit the {Transfer} event. log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id) } } /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`. function safeTransferFrom(address from, address to, uint256 id) public payable virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, ""); } /// @dev Transfers token `id` from `from` to `to`. /// /// Requirements: /// /// - Token `id` must exist. /// - `from` must be the owner of the token. /// - `to` cannot be the zero address. /// - The caller must be the owner of the token, or be approved to manage the token. /// - If `to` refers to a smart contract, it must implement /// {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. /// /// Emits a {Transfer} event. function safeTransferFrom(address from, address to, uint256 id, bytes calldata data) public virtual { transferFrom(from, to, id); if (_hasCode(to)) _checkOnERC721Received(from, to, id, data); } /// @dev Returns true if this contract implements the interface defined by `interfaceId`. /// See: https://eips.ethereum.org/EIPS/eip-165 /// This function call must use less than 30000 gas. function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) { /// @solidity memory-safe-assembly assembly { let s := shr(224, interfaceId) // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f. result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f)) } } /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* MIRROR OPERATIONS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the address of the base DN404 contract. function baseERC20() public view virtual returns (address base) { base = _getDN404NFTStorage().baseERC20; if (base == address(0)) revert NotLinked(); } /// @dev Fallback modifier to execute calls from the base DN404 contract. modifier dn404NFTFallback() virtual { DN404NFTStorage storage $ = _getDN404NFTStorage(); uint256 fnSelector = _calldataload(0x00) >> 224; // `logTransfer(uint256[])`. if (fnSelector == 0x263c69d6) { if (msg.sender != $.baseERC20) revert SenderNotBase(); /// @solidity memory-safe-assembly assembly { // When returndatacopy copies 1 or more out-of-bounds bytes, it reverts. returndatacopy(0x00, returndatasize(), lt(calldatasize(), 0x20)) let o := add(0x24, calldataload(0x04)) // Packed logs offset. returndatacopy(0x00, returndatasize(), lt(calldatasize(), o)) let end := add(o, shl(5, calldataload(sub(o, 0x20)))) returndatacopy(0x00, returndatasize(), lt(calldatasize(), end)) for {} iszero(eq(o, end)) { o := add(0x20, o) } { let d := calldataload(o) // Entry in the packed logs. let a := shr(96, d) // The address. let b := and(1, d) // Whether it is a burn. log4( codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, mul(a, b), mul(a, iszero(b)), shr(168, shl(160, d)) ) } mstore(0x00, 0x01) return(0x00, 0x20) } } // `linkMirrorContract(address)`. if (fnSelector == 0x0f4599e5) { if ($.deployer != address(0)) { if (address(uint160(_calldataload(0x04))) != $.deployer) { revert SenderNotDeployer(); } } if ($.baseERC20 != address(0)) revert AlreadyLinked(); $.baseERC20 = msg.sender; /// @solidity memory-safe-assembly assembly { mstore(0x00, 0x01) return(0x00, 0x20) } } _; } /// @dev Fallback function for calls from base DN404 contract. fallback() external payable virtual dn404NFTFallback {} receive() external payable virtual {} /*«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-«-*/ /* PRIVATE HELPERS */ /*-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»-»*/ /// @dev Returns the calldata value at `offset`. function _calldataload(uint256 offset) private pure returns (uint256 value) { /// @solidity memory-safe-assembly assembly { value := calldataload(offset) } } /// @dev Returns if `a` has bytecode of non-zero length. function _hasCode(address a) private view returns (bool result) { /// @solidity memory-safe-assembly assembly { result := extcodesize(a) // Can handle dirty upper bits. } } /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`. /// Reverts if the target does not support the function correctly. function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data) private { /// @solidity memory-safe-assembly assembly { // Prepare the calldata. let m := mload(0x40) let onERC721ReceivedSelector := 0x150b7a02 mstore(m, onERC721ReceivedSelector) mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`. mstore(add(m, 0x40), shr(96, shl(96, from))) mstore(add(m, 0x60), id) mstore(add(m, 0x80), 0x80) let n := mload(data) mstore(add(m, 0xa0), n) if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) } // Revert if the call reverts. if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) { if returndatasize() { // Bubble up the revert if the call reverts. returndatacopy(m, 0x00, returndatasize()) revert(m, returndatasize()) } } // Load the returndata and compare it. if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) { mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`. revert(0x1c, 0x04) } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { IMessageLibManager } from "./IMessageLibManager.sol"; import { IMessagingComposer } from "./IMessagingComposer.sol"; import { IMessagingChannel } from "./IMessagingChannel.sol"; import { IMessagingContext } from "./IMessagingContext.sol"; struct MessagingParams { uint32 dstEid; bytes32 receiver; bytes message; bytes options; bool payInLzToken; } struct MessagingReceipt { bytes32 guid; uint64 nonce; MessagingFee fee; } struct MessagingFee { uint256 nativeFee; uint256 lzTokenFee; } struct Origin { uint32 srcEid; bytes32 sender; uint64 nonce; } interface ILayerZeroEndpointV2 is IMessageLibManager, IMessagingComposer, IMessagingChannel, IMessagingContext { event PacketSent(bytes encodedPayload, bytes options, address sendLibrary); event PacketVerified(Origin origin, address receiver, bytes32 payloadHash); event PacketDelivered(Origin origin, address receiver); event LzReceiveAlert( address indexed receiver, address indexed executor, Origin origin, bytes32 guid, uint256 gas, uint256 value, bytes message, bytes extraData, bytes reason ); event LzTokenSet(address token); event DelegateSet(address sender, address delegate); function quote(MessagingParams calldata _params, address _sender) external view returns (MessagingFee memory); function send( MessagingParams calldata _params, address _refundAddress ) external payable returns (MessagingReceipt memory); function verify(Origin calldata _origin, address _receiver, bytes32 _payloadHash) external; function verifiable(Origin calldata _origin, address _receiver) external view returns (bool); function initializable(Origin calldata _origin, address _receiver) external view returns (bool); function lzReceive( Origin calldata _origin, address _receiver, bytes32 _guid, bytes calldata _message, bytes calldata _extraData ) external payable; // oapp can burn messages partially by calling this function with its own business logic if messages are verified in order function clear(address _oapp, Origin calldata _origin, bytes32 _guid, bytes calldata _message) external; function setLzToken(address _lzToken) external; function lzToken() external view returns (address); function nativeToken() external view returns (address); function setDelegate(address _delegate) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { Origin } from "./ILayerZeroEndpointV2.sol"; interface ILayerZeroReceiver { function allowInitializePath(Origin calldata _origin) external view returns (bool); function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64); function lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import { SetConfigParam } from "./IMessageLibManager.sol"; enum MessageLibType { Send, Receive, SendAndReceive } interface IMessageLib is IERC165 { function setConfig(address _oapp, SetConfigParam[] calldata _config) external; function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config); function isSupportedEid(uint32 _eid) external view returns (bool); // message libs of same major version are compatible function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion); function messageLibType() external view returns (MessageLibType); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; struct SetConfigParam { uint32 eid; uint32 configType; bytes config; } interface IMessageLibManager { struct Timeout { address lib; uint256 expiry; } event LibraryRegistered(address newLib); event DefaultSendLibrarySet(uint32 eid, address newLib); event DefaultReceiveLibrarySet(uint32 eid, address newLib); event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry); event SendLibrarySet(address sender, uint32 eid, address newLib); event ReceiveLibrarySet(address receiver, uint32 eid, address newLib); event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout); function registerLibrary(address _lib) external; function isRegisteredLibrary(address _lib) external view returns (bool); function getRegisteredLibraries() external view returns (address[] memory); function setDefaultSendLibrary(uint32 _eid, address _newLib) external; function defaultSendLibrary(uint32 _eid) external view returns (address); function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _gracePeriod) external; function defaultReceiveLibrary(uint32 _eid) external view returns (address); function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external; function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry); function isSupportedEid(uint32 _eid) external view returns (bool); function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool); /// ------------------- OApp interfaces ------------------- function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external; function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib); function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool); function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external; function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault); function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _expiry) external; function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry); function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external; function getConfig( address _oapp, address _lib, uint32 _eid, uint32 _configType ) external view returns (bytes memory config); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingChannel { event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce); event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); function eid() external view returns (uint32); // this is an emergency function if a message cannot be verified for some reasons // required to provide _nextNonce to avoid race condition function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external; function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32); function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64); function inboundPayloadHash( address _receiver, uint32 _srcEid, bytes32 _sender, uint64 _nonce ) external view returns (bytes32); function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingComposer { event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message); event ComposeDelivered(address from, address to, bytes32 guid, uint16 index); event LzComposeAlert( address indexed from, address indexed to, address indexed executor, bytes32 guid, uint16 index, uint256 gas, uint256 value, bytes message, bytes extraData, bytes reason ); function composeQueue( address _from, address _to, bytes32 _guid, uint16 _index ) external view returns (bytes32 messageHash); function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external; function lzCompose( address _from, address _to, bytes32 _guid, uint16 _index, bytes calldata _message, bytes calldata _extraData ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IMessagingContext { function isSendingMessage() external view returns (bool); function getSendContext() external view returns (uint32 dstEid, address sender); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { MessagingFee } from "./ILayerZeroEndpointV2.sol"; import { IMessageLib } from "./IMessageLib.sol"; struct Packet { uint64 nonce; uint32 srcEid; address sender; uint32 dstEid; bytes32 receiver; bytes32 guid; bytes message; } interface ISendLib is IMessageLib { function send( Packet calldata _packet, bytes calldata _options, bool _payInLzToken ) external returns (MessagingFee memory, bytes memory encodedPacket); function quote( Packet calldata _packet, bytes calldata _options, bool _payInLzToken ) external view returns (MessagingFee memory); function setTreasury(address _treasury) external; function withdrawFee(address _to, uint256 _amount) external; function withdrawLzTokenFee(address _lzToken, address _to, uint256 _amount) external; }
// SPDX-License-Identifier: LZBL-1.2 pragma solidity ^0.8.20; library AddressCast { error AddressCast_InvalidSizeForAddress(); error AddressCast_InvalidAddress(); function toBytes32(bytes calldata _addressBytes) internal pure returns (bytes32 result) { if (_addressBytes.length > 32) revert AddressCast_InvalidAddress(); result = bytes32(_addressBytes); unchecked { uint256 offset = 32 - _addressBytes.length; result = result >> (offset * 8); } } function toBytes32(address _address) internal pure returns (bytes32 result) { result = bytes32(uint256(uint160(_address))); } function toBytes(bytes32 _addressBytes32, uint256 _size) internal pure returns (bytes memory result) { if (_size == 0 || _size > 32) revert AddressCast_InvalidSizeForAddress(); result = new bytes(_size); unchecked { uint256 offset = 256 - _size * 8; assembly { mstore(add(result, 32), shl(offset, _addressBytes32)) } } } function toAddress(bytes32 _addressBytes32) internal pure returns (address result) { result = address(uint160(uint256(_addressBytes32))); } function toAddress(bytes calldata _addressBytes) internal pure returns (address result) { if (_addressBytes.length != 20) revert AddressCast_InvalidAddress(); result = address(bytes20(_addressBytes)); } }
// SPDX-License-Identifier: LZBL-1.2 pragma solidity ^0.8.20; import { Packet } from "../../interfaces/ISendLib.sol"; import { AddressCast } from "../../libs/AddressCast.sol"; library PacketV1Codec { using AddressCast for address; using AddressCast for bytes32; uint8 internal constant PACKET_VERSION = 1; // header (version + nonce + path) // version uint256 private constant PACKET_VERSION_OFFSET = 0; // nonce uint256 private constant NONCE_OFFSET = 1; // path uint256 private constant SRC_EID_OFFSET = 9; uint256 private constant SENDER_OFFSET = 13; uint256 private constant DST_EID_OFFSET = 45; uint256 private constant RECEIVER_OFFSET = 49; // payload (guid + message) uint256 private constant GUID_OFFSET = 81; // keccak256(nonce + path) uint256 private constant MESSAGE_OFFSET = 113; function encode(Packet memory _packet) internal pure returns (bytes memory encodedPacket) { encodedPacket = abi.encodePacked( PACKET_VERSION, _packet.nonce, _packet.srcEid, _packet.sender.toBytes32(), _packet.dstEid, _packet.receiver, _packet.guid, _packet.message ); } function encodePacketHeader(Packet memory _packet) internal pure returns (bytes memory) { return abi.encodePacked( PACKET_VERSION, _packet.nonce, _packet.srcEid, _packet.sender.toBytes32(), _packet.dstEid, _packet.receiver ); } function encodePayload(Packet memory _packet) internal pure returns (bytes memory) { return abi.encodePacked(_packet.guid, _packet.message); } function header(bytes calldata _packet) internal pure returns (bytes calldata) { return _packet[0:GUID_OFFSET]; } function version(bytes calldata _packet) internal pure returns (uint8) { return uint8(bytes1(_packet[PACKET_VERSION_OFFSET:NONCE_OFFSET])); } function nonce(bytes calldata _packet) internal pure returns (uint64) { return uint64(bytes8(_packet[NONCE_OFFSET:SRC_EID_OFFSET])); } function srcEid(bytes calldata _packet) internal pure returns (uint32) { return uint32(bytes4(_packet[SRC_EID_OFFSET:SENDER_OFFSET])); } function sender(bytes calldata _packet) internal pure returns (bytes32) { return bytes32(_packet[SENDER_OFFSET:DST_EID_OFFSET]); } function senderAddressB20(bytes calldata _packet) internal pure returns (address) { return sender(_packet).toAddress(); } function dstEid(bytes calldata _packet) internal pure returns (uint32) { return uint32(bytes4(_packet[DST_EID_OFFSET:RECEIVER_OFFSET])); } function receiver(bytes calldata _packet) internal pure returns (bytes32) { return bytes32(_packet[RECEIVER_OFFSET:GUID_OFFSET]); } function receiverB20(bytes calldata _packet) internal pure returns (address) { return receiver(_packet).toAddress(); } function guid(bytes calldata _packet) internal pure returns (bytes32) { return bytes32(_packet[GUID_OFFSET:MESSAGE_OFFSET]); } function message(bytes calldata _packet) internal pure returns (bytes calldata) { return bytes(_packet[MESSAGE_OFFSET:]); } function payload(bytes calldata _packet) internal pure returns (bytes calldata) { return bytes(_packet[GUID_OFFSET:]); } function payloadHash(bytes calldata _packet) internal pure returns (bytes32) { return keccak256(payload(_packet)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; // @dev Import the 'MessagingFee' and 'MessagingReceipt' so it's exposed to OApp implementers // solhint-disable-next-line no-unused-import import { OAppSender, MessagingFee, MessagingReceipt } from "./OAppSender.sol"; // @dev Import the 'Origin' so it's exposed to OApp implementers // solhint-disable-next-line no-unused-import import { OAppReceiver, Origin } from "./OAppReceiver.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OApp * @dev Abstract contract serving as the base for OApp implementation, combining OAppSender and OAppReceiver functionality. */ abstract contract OApp is OAppSender, OAppReceiver { /** * @dev Constructor to initialize the OApp with the provided endpoint and owner. * @param _endpoint The address of the LOCAL LayerZero endpoint. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. */ constructor(address _endpoint, address _delegate) OAppCore(_endpoint, _delegate) {} /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol implementation. * @return receiverVersion The version of the OAppReceiver.sol implementation. */ function oAppVersion() public pure virtual override(OAppSender, OAppReceiver) returns (uint64 senderVersion, uint64 receiverVersion) { return (SENDER_VERSION, RECEIVER_VERSION); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IOAppCore, ILayerZeroEndpointV2 } from "./interfaces/IOAppCore.sol"; /** * @title OAppCore * @dev Abstract contract implementing the IOAppCore interface with basic OApp configurations. */ abstract contract OAppCore is IOAppCore, Ownable { // The LayerZero endpoint associated with the given OApp ILayerZeroEndpointV2 public immutable endpoint; // Mapping to store peers associated with corresponding endpoints mapping(uint32 eid => bytes32 peer) public peers; /** * @dev Constructor to initialize the OAppCore with the provided endpoint and delegate. * @param _endpoint The address of the LOCAL Layer Zero endpoint. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. * * @dev The delegate typically should be set as the owner of the contract. */ constructor(address _endpoint, address _delegate) { endpoint = ILayerZeroEndpointV2(_endpoint); if (_delegate == address(0)) revert InvalidDelegate(); endpoint.setDelegate(_delegate); } /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. * * @dev Only the owner/admin of the OApp can call this function. * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp. * @dev Set this to bytes32(0) to remove the peer address. * @dev Peer is a bytes32 to accommodate non-evm chains. */ function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyOwner { _setPeer(_eid, _peer); } /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. * * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp. * @dev Set this to bytes32(0) to remove the peer address. * @dev Peer is a bytes32 to accommodate non-evm chains. */ function _setPeer(uint32 _eid, bytes32 _peer) internal virtual { peers[_eid] = _peer; emit PeerSet(_eid, _peer); } /** * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set. * ie. the peer is set to bytes32(0). * @param _eid The endpoint ID. * @return peer The address of the peer associated with the specified endpoint. */ function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) { bytes32 peer = peers[_eid]; if (peer == bytes32(0)) revert NoPeer(_eid); return peer; } /** * @notice Sets the delegate address for the OApp. * @param _delegate The address of the delegate to be set. * * @dev Only the owner/admin of the OApp can call this function. * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract. */ function setDelegate(address _delegate) public onlyOwner { endpoint.setDelegate(_delegate); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { IOAppReceiver, Origin } from "./interfaces/IOAppReceiver.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OAppReceiver * @dev Abstract contract implementing the ILayerZeroReceiver interface and extending OAppCore for OApp receivers. */ abstract contract OAppReceiver is IOAppReceiver, OAppCore { // Custom error message for when the caller is not the registered endpoint/ error OnlyEndpoint(address addr); // @dev The version of the OAppReceiver implementation. // @dev Version is bumped when changes are made to this contract. uint64 internal constant RECEIVER_VERSION = 2; /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. * * @dev Providing 0 as the default for OAppSender version. Indicates that the OAppSender is not implemented. * ie. this is a RECEIVE only OApp. * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions. */ function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) { return (0, RECEIVER_VERSION); } /** * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint. * @dev _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @dev _message The lzReceive payload. * @param _sender The sender address. * @return isSender Is a valid sender. * * @dev Applications can optionally choose to implement separate composeMsg senders that are NOT the bridging layer. * @dev The default sender IS the OAppReceiver implementer. */ function isComposeMsgSender( Origin calldata /*_origin*/, bytes calldata /*_message*/, address _sender ) public view virtual returns (bool) { return _sender == address(this); } /** * @notice Checks if the path initialization is allowed based on the provided origin. * @param origin The origin information containing the source endpoint and sender address. * @return Whether the path has been initialized. * * @dev This indicates to the endpoint that the OApp has enabled msgs for this particular path to be received. * @dev This defaults to assuming if a peer has been set, its initialized. * Can be overridden by the OApp if there is other logic to determine this. */ function allowInitializePath(Origin calldata origin) public view virtual returns (bool) { return peers[origin.srcEid] == origin.sender; } /** * @notice Retrieves the next nonce for a given source endpoint and sender address. * @dev _srcEid The source endpoint ID. * @dev _sender The sender address. * @return nonce The next nonce. * * @dev The path nonce starts from 1. If 0 is returned it means that there is NO nonce ordered enforcement. * @dev Is required by the off-chain executor to determine the OApp expects msg execution is ordered. * @dev This is also enforced by the OApp. * @dev By default this is NOT enabled. ie. nextNonce is hardcoded to return 0. */ function nextNonce(uint32 /*_srcEid*/, bytes32 /*_sender*/) public view virtual returns (uint64 nonce) { return 0; } /** * @dev Entry point for receiving messages or packets from the endpoint. * @param _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @param _guid The unique identifier for the received LayerZero message. * @param _message The payload of the received message. * @param _executor The address of the executor for the received message. * @param _extraData Additional arbitrary data provided by the corresponding executor. * * @dev Entry point for receiving msg/packet from the LayerZero endpoint. */ function lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) public payable virtual { // Ensures that only the endpoint can attempt to lzReceive() messages to this OApp. if (address(endpoint) != msg.sender) revert OnlyEndpoint(msg.sender); // Ensure that the sender matches the expected peer for the source endpoint. if (_getPeerOrRevert(_origin.srcEid) != _origin.sender) revert OnlyPeer(_origin.srcEid, _origin.sender); // Call the internal OApp implementation of lzReceive. _lzReceive(_origin, _guid, _message, _executor, _extraData); } /** * @dev Internal function to implement lzReceive logic without needing to copy the basic parameter validation. */ function _lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) internal virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { MessagingParams, MessagingFee, MessagingReceipt } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import { OAppCore } from "./OAppCore.sol"; /** * @title OAppSender * @dev Abstract contract implementing the OAppSender functionality for sending messages to a LayerZero endpoint. */ abstract contract OAppSender is OAppCore { using SafeERC20 for IERC20; // Custom error messages error NotEnoughNative(uint256 msgValue); error LzTokenUnavailable(); // @dev The version of the OAppSender implementation. // @dev Version is bumped when changes are made to this contract. uint64 internal constant SENDER_VERSION = 1; /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. * * @dev Providing 0 as the default for OAppReceiver version. Indicates that the OAppReceiver is not implemented. * ie. this is a SEND only OApp. * @dev If the OApp uses both OAppSender and OAppReceiver, then this needs to be override returning the correct versions */ function oAppVersion() public view virtual returns (uint64 senderVersion, uint64 receiverVersion) { return (SENDER_VERSION, 0); } /** * @dev Internal function to interact with the LayerZero EndpointV2.quote() for fee calculation. * @param _dstEid The destination endpoint ID. * @param _message The message payload. * @param _options Additional options for the message. * @param _payInLzToken Flag indicating whether to pay the fee in LZ tokens. * @return fee The calculated MessagingFee for the message. * - nativeFee: The native fee for the message. * - lzTokenFee: The LZ token fee for the message. */ function _quote( uint32 _dstEid, bytes memory _message, bytes memory _options, bool _payInLzToken ) internal view virtual returns (MessagingFee memory fee) { return endpoint.quote( MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _payInLzToken), address(this) ); } /** * @dev Internal function to interact with the LayerZero EndpointV2.send() for sending a message. * @param _dstEid The destination endpoint ID. * @param _message The message payload. * @param _options Additional options for the message. * @param _fee The calculated LayerZero fee for the message. * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. * @param _refundAddress The address to receive any excess fee values sent to the endpoint. * @return receipt The receipt for the sent message. * - guid: The unique identifier for the sent message. * - nonce: The nonce of the sent message. * - fee: The LayerZero fee incurred for the message. */ function _lzSend( uint32 _dstEid, bytes memory _message, bytes memory _options, MessagingFee memory _fee, address _refundAddress ) internal virtual returns (MessagingReceipt memory receipt) { // @dev Push corresponding fees to the endpoint, any excess is sent back to the _refundAddress from the endpoint. uint256 messageValue = _payNative(_fee.nativeFee); if (_fee.lzTokenFee > 0) _payLzToken(_fee.lzTokenFee); return // solhint-disable-next-line check-send-result endpoint.send{ value: messageValue }( MessagingParams(_dstEid, _getPeerOrRevert(_dstEid), _message, _options, _fee.lzTokenFee > 0), _refundAddress ); } /** * @dev Internal function to pay the native fee associated with the message. * @param _nativeFee The native fee to be paid. * @return nativeFee The amount of native currency paid. * * @dev If the OApp needs to initiate MULTIPLE LayerZero messages in a single transaction, * this will need to be overridden because msg.value would contain multiple lzFees. * @dev Should be overridden in the event the LayerZero endpoint requires a different native currency. * @dev Some EVMs use an ERC20 as a method for paying transactions/gasFees. * @dev The endpoint is EITHER/OR, ie. it will NOT support both types of native payment at a time. */ function _payNative(uint256 _nativeFee) internal virtual returns (uint256 nativeFee) { if (msg.value != _nativeFee) revert NotEnoughNative(msg.value); return _nativeFee; } /** * @dev Internal function to pay the LZ token fee associated with the message. * @param _lzTokenFee The LZ token fee to be paid. * * @dev If the caller is trying to pay in the specified lzToken, then the lzTokenFee is passed to the endpoint. * @dev Any excess sent, is passed back to the specified _refundAddress in the _lzSend(). */ function _payLzToken(uint256 _lzTokenFee) internal virtual { // @dev Cannot cache the token because it is not immutable in the endpoint. address lzToken = endpoint.lzToken(); if (lzToken == address(0)) revert LzTokenUnavailable(); // Pay LZ token fee by sending tokens to the endpoint. IERC20(lzToken).safeTransferFrom(msg.sender, address(endpoint), _lzTokenFee); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { ILayerZeroEndpointV2 } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; /** * @title IOAppCore */ interface IOAppCore { // Custom error messages error OnlyPeer(uint32 eid, bytes32 sender); error NoPeer(uint32 eid); error InvalidEndpointCall(); error InvalidDelegate(); // Event emitted when a peer (OApp) is set for a corresponding endpoint event PeerSet(uint32 eid, bytes32 peer); /** * @notice Retrieves the OApp version information. * @return senderVersion The version of the OAppSender.sol contract. * @return receiverVersion The version of the OAppReceiver.sol contract. */ function oAppVersion() external view returns (uint64 senderVersion, uint64 receiverVersion); /** * @notice Retrieves the LayerZero endpoint associated with the OApp. * @return iEndpoint The LayerZero endpoint as an interface. */ function endpoint() external view returns (ILayerZeroEndpointV2 iEndpoint); /** * @notice Retrieves the peer (OApp) associated with a corresponding endpoint. * @param _eid The endpoint ID. * @return peer The peer address (OApp instance) associated with the corresponding endpoint. */ function peers(uint32 _eid) external view returns (bytes32 peer); /** * @notice Sets the peer address (OApp instance) for a corresponding endpoint. * @param _eid The endpoint ID. * @param _peer The address of the peer to be associated with the corresponding endpoint. */ function setPeer(uint32 _eid, bytes32 _peer) external; /** * @notice Sets the delegate address for the OApp Core. * @param _delegate The address of the delegate to be set. */ function setDelegate(address _delegate) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /** * @title IOAppMsgInspector * @dev Interface for the OApp Message Inspector, allowing examination of message and options contents. */ interface IOAppMsgInspector { // Custom error message for inspection failure error InspectionFailed(bytes message, bytes options); /** * @notice Allows the inspector to examine LayerZero message contents and optionally throw a revert if invalid. * @param _message The message payload to be inspected. * @param _options Additional options or parameters for inspection. * @return valid A boolean indicating whether the inspection passed (true) or failed (false). * * @dev Optionally done as a revert, OR use the boolean provided to handle the failure. */ function inspect(bytes calldata _message, bytes calldata _options) external view returns (bool valid); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /** * @dev Struct representing enforced option parameters. */ struct EnforcedOptionParam { uint32 eid; // Endpoint ID uint16 msgType; // Message Type bytes options; // Additional options } /** * @title IOAppOptionsType3 * @dev Interface for the OApp with Type 3 Options, allowing the setting and combining of enforced options. */ interface IOAppOptionsType3 { // Custom error message for invalid options error InvalidOptions(bytes options); // Event emitted when enforced options are set event EnforcedOptionSet(EnforcedOptionParam[] _enforcedOptions); /** * @notice Sets enforced options for specific endpoint and message type combinations. * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options. */ function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) external; /** * @notice Combines options for a given endpoint and message type. * @param _eid The endpoint ID. * @param _msgType The OApp message type. * @param _extraOptions Additional options passed by the caller. * @return options The combination of caller specified options AND enforced options. */ function combineOptions( uint32 _eid, uint16 _msgType, bytes calldata _extraOptions ) external view returns (bytes memory options); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { ILayerZeroReceiver, Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol"; interface IOAppReceiver is ILayerZeroReceiver { /** * @notice Indicates whether an address is an approved composeMsg sender to the Endpoint. * @param _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @param _message The lzReceive payload. * @param _sender The sender address. * @return isSender Is a valid sender. * * @dev Applications can optionally choose to implement a separate composeMsg sender that is NOT the bridging layer. * @dev The default sender IS the OAppReceiver implementer. */ function isComposeMsgSender( Origin calldata _origin, bytes calldata _message, address _sender ) external view returns (bool isSender); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IOAppOptionsType3, EnforcedOptionParam } from "../interfaces/IOAppOptionsType3.sol"; /** * @title OAppOptionsType3 * @dev Abstract contract implementing the IOAppOptionsType3 interface with type 3 options. */ abstract contract OAppOptionsType3 is IOAppOptionsType3, Ownable { uint16 internal constant OPTION_TYPE_3 = 3; // @dev The "msgType" should be defined in the child contract. mapping(uint32 eid => mapping(uint16 msgType => bytes enforcedOption)) public enforcedOptions; /** * @dev Sets the enforced options for specific endpoint and message type combinations. * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options. * * @dev Only the owner/admin of the OApp can call this function. * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc. * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose(). */ function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyOwner { _setEnforcedOptions(_enforcedOptions); } /** * @dev Sets the enforced options for specific endpoint and message type combinations. * @param _enforcedOptions An array of EnforcedOptionParam structures specifying enforced options. * * @dev Provides a way for the OApp to enforce things like paying for PreCrime, AND/OR minimum dst lzReceive gas amounts etc. * @dev These enforced options can vary as the potential options/execution on the remote may differ as per the msgType. * eg. Amount of lzReceive() gas necessary to deliver a lzCompose() message adds overhead you dont want to pay * if you are only making a standard LayerZero message ie. lzReceive() WITHOUT sendCompose(). */ function _setEnforcedOptions(EnforcedOptionParam[] memory _enforcedOptions) internal virtual { for (uint256 i = 0; i < _enforcedOptions.length; i++) { // @dev Enforced options are only available for optionType 3, as type 1 and 2 dont support combining. _assertOptionsType3(_enforcedOptions[i].options); enforcedOptions[_enforcedOptions[i].eid][_enforcedOptions[i].msgType] = _enforcedOptions[i].options; } emit EnforcedOptionSet(_enforcedOptions); } /** * @notice Combines options for a given endpoint and message type. * @param _eid The endpoint ID. * @param _msgType The OAPP message type. * @param _extraOptions Additional options passed by the caller. * @return options The combination of caller specified options AND enforced options. * * @dev If there is an enforced lzReceive option: * - {gasLimit: 200k, msg.value: 1 ether} AND a caller supplies a lzReceive option: {gasLimit: 100k, msg.value: 0.5 ether} * - The resulting options will be {gasLimit: 300k, msg.value: 1.5 ether} when the message is executed on the remote lzReceive() function. * @dev This presence of duplicated options is handled off-chain in the verifier/executor. */ function combineOptions( uint32 _eid, uint16 _msgType, bytes calldata _extraOptions ) public view virtual returns (bytes memory) { bytes memory enforced = enforcedOptions[_eid][_msgType]; // No enforced options, pass whatever the caller supplied, even if it's empty or legacy type 1/2 options. if (enforced.length == 0) return _extraOptions; // No caller options, return enforced if (_extraOptions.length == 0) return enforced; // @dev If caller provided _extraOptions, must be type 3 as its the ONLY type that can be combined. if (_extraOptions.length >= 2) { _assertOptionsType3(_extraOptions); // @dev Remove the first 2 bytes containing the type from the _extraOptions and combine with enforced. return bytes.concat(enforced, _extraOptions[2:]); } // No valid set of options was found. revert InvalidOptions(_extraOptions); } /** * @dev Internal function to assert that options are of type 3. * @param _options The options to be checked. */ function _assertOptionsType3(bytes memory _options) internal pure virtual { uint16 optionsType; assembly { optionsType := mload(add(_options, 2)) } if (optionsType != OPTION_TYPE_3) revert InvalidOptions(_options); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IPreCrime } from "./interfaces/IPreCrime.sol"; import { IOAppPreCrimeSimulator, InboundPacket, Origin } from "./interfaces/IOAppPreCrimeSimulator.sol"; /** * @title OAppPreCrimeSimulator * @dev Abstract contract serving as the base for preCrime simulation functionality in an OApp. */ abstract contract OAppPreCrimeSimulator is IOAppPreCrimeSimulator, Ownable { // The address of the preCrime implementation. address public preCrime; /** * @dev Retrieves the address of the OApp contract. * @return The address of the OApp contract. * * @dev The simulator contract is the base contract for the OApp by default. * @dev If the simulator is a separate contract, override this function. */ function oApp() external view virtual returns (address) { return address(this); } /** * @dev Sets the preCrime contract address. * @param _preCrime The address of the preCrime contract. */ function setPreCrime(address _preCrime) public virtual onlyOwner { preCrime = _preCrime; emit PreCrimeSet(_preCrime); } /** * @dev Interface for pre-crime simulations. Always reverts at the end with the simulation results. * @param _packets An array of InboundPacket objects representing received packets to be delivered. * * @dev WARNING: MUST revert at the end with the simulation results. * @dev Gives the preCrime implementation the ability to mock sending packets to the lzReceive function, * WITHOUT actually executing them. */ function lzReceiveAndRevert(InboundPacket[] calldata _packets) public payable virtual { for (uint256 i = 0; i < _packets.length; i++) { InboundPacket calldata packet = _packets[i]; // Ignore packets that are not from trusted peers. if (!isPeer(packet.origin.srcEid, packet.origin.sender)) continue; // @dev Because a verifier is calling this function, it doesnt have access to executor params: // - address _executor // - bytes calldata _extraData // preCrime will NOT work for OApps that rely on these two parameters inside of their _lzReceive(). // They are instead stubbed to default values, address(0) and bytes("") // @dev Calling this.lzReceiveSimulate removes ability for assembly return 0 callstack exit, // which would cause the revert to be ignored. this.lzReceiveSimulate{ value: packet.value }( packet.origin, packet.guid, packet.message, packet.executor, packet.extraData ); } // @dev Revert with the simulation results. msg.sender must implement IPreCrime.buildSimulationResult(). revert SimulationResult(IPreCrime(msg.sender).buildSimulationResult()); } /** * @dev Is effectively an internal function because msg.sender must be address(this). * Allows resetting the call stack for 'internal' calls. * @param _origin The origin information containing the source endpoint and sender address. * - srcEid: The source chain endpoint ID. * - sender: The sender address on the src chain. * - nonce: The nonce of the message. * @param _guid The unique identifier of the packet. * @param _message The message payload of the packet. * @param _executor The executor address for the packet. * @param _extraData Additional data for the packet. */ function lzReceiveSimulate( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) external payable virtual { // @dev Ensure ONLY can be called 'internally'. if (msg.sender != address(this)) revert OnlySelf(); _lzReceiveSimulate(_origin, _guid, _message, _executor, _extraData); } /** * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive. * @param _origin The origin information. * - srcEid: The source chain endpoint ID. * - sender: The sender address from the src chain. * - nonce: The nonce of the LayerZero message. * @param _guid The GUID of the LayerZero message. * @param _message The LayerZero message. * @param _executor The address of the off-chain executor. * @param _extraData Arbitrary data passed by the msg executor. * * @dev Enables the preCrime simulator to mock sending lzReceive() messages, * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver. */ function _lzReceiveSimulate( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) internal virtual; /** * @dev checks if the specified peer is considered 'trusted' by the OApp. * @param _eid The endpoint Id to check. * @param _peer The peer to check. * @return Whether the peer passed is considered 'trusted' by the OApp. */ function isPeer(uint32 _eid, bytes32 _peer) public view virtual returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; // @dev Import the Origin so it's exposed to OAppPreCrimeSimulator implementers. // solhint-disable-next-line no-unused-import import { InboundPacket, Origin } from "../libs/Packet.sol"; /** * @title IOAppPreCrimeSimulator Interface * @dev Interface for the preCrime simulation functionality in an OApp. */ interface IOAppPreCrimeSimulator { // @dev simulation result used in PreCrime implementation error SimulationResult(bytes result); error OnlySelf(); /** * @dev Emitted when the preCrime contract address is set. * @param preCrimeAddress The address of the preCrime contract. */ event PreCrimeSet(address preCrimeAddress); /** * @dev Retrieves the address of the preCrime contract implementation. * @return The address of the preCrime contract. */ function preCrime() external view returns (address); /** * @dev Retrieves the address of the OApp contract. * @return The address of the OApp contract. */ function oApp() external view returns (address); /** * @dev Sets the preCrime contract address. * @param _preCrime The address of the preCrime contract. */ function setPreCrime(address _preCrime) external; /** * @dev Mocks receiving a packet, then reverts with a series of data to infer the state/result. * @param _packets An array of LayerZero InboundPacket objects representing received packets. */ function lzReceiveAndRevert(InboundPacket[] calldata _packets) external payable; /** * @dev checks if the specified peer is considered 'trusted' by the OApp. * @param _eid The endpoint Id to check. * @param _peer The peer to check. * @return Whether the peer passed is considered 'trusted' by the OApp. */ function isPeer(uint32 _eid, bytes32 _peer) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; struct PreCrimePeer { uint32 eid; bytes32 preCrime; bytes32 oApp; } // TODO not done yet interface IPreCrime { error OnlyOffChain(); // for simulate() error PacketOversize(uint256 max, uint256 actual); error PacketUnsorted(); error SimulationFailed(bytes reason); // for preCrime() error SimulationResultNotFound(uint32 eid); error InvalidSimulationResult(uint32 eid, bytes reason); error CrimeFound(bytes crime); function getConfig(bytes[] calldata _packets, uint256[] calldata _packetMsgValues) external returns (bytes memory); function simulate( bytes[] calldata _packets, uint256[] calldata _packetMsgValues ) external payable returns (bytes memory); function buildSimulationResult() external view returns (bytes memory); function preCrime( bytes[] calldata _packets, uint256[] calldata _packetMsgValues, bytes[] calldata _simulations ) external; function version() external view returns (uint64 major, uint8 minor); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol"; import { PacketV1Codec } from "@layerzerolabs/lz-evm-protocol-v2/contracts/messagelib/libs/PacketV1Codec.sol"; /** * @title InboundPacket * @dev Structure representing an inbound packet received by the contract. */ struct InboundPacket { Origin origin; // Origin information of the packet. uint32 dstEid; // Destination endpointId of the packet. address receiver; // Receiver address for the packet. bytes32 guid; // Unique identifier of the packet. uint256 value; // msg.value of the packet. address executor; // Executor address for the packet. bytes message; // Message payload of the packet. bytes extraData; // Additional arbitrary data for the packet. } /** * @title PacketDecoder * @dev Library for decoding LayerZero packets. */ library PacketDecoder { using PacketV1Codec for bytes; /** * @dev Decode an inbound packet from the given packet data. * @param _packet The packet data to decode. * @return packet An InboundPacket struct representing the decoded packet. */ function decode(bytes calldata _packet) internal pure returns (InboundPacket memory packet) { packet.origin = Origin(_packet.srcEid(), _packet.sender(), _packet.nonce()); packet.dstEid = _packet.dstEid(); packet.receiver = _packet.receiverB20(); packet.guid = _packet.guid(); packet.message = _packet.message(); } /** * @dev Decode multiple inbound packets from the given packet data and associated message values. * @param _packets An array of packet data to decode. * @param _packetMsgValues An array of associated message values for each packet. * @return packets An array of InboundPacket structs representing the decoded packets. */ function decode( bytes[] calldata _packets, uint256[] memory _packetMsgValues ) internal pure returns (InboundPacket[] memory packets) { packets = new InboundPacket[](_packets.length); for (uint256 i = 0; i < _packets.length; i++) { bytes calldata packet = _packets[i]; packets[i] = PacketDecoder.decode(packet); // @dev Allows the verifier to specify the msg.value that gets passed in lzReceive. packets[i].value = _packetMsgValues[i]; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { OApp, Origin } from "@layerzerolabs/oapp-evm/contracts/oapp/OApp.sol"; import { OAppOptionsType3 } from "@layerzerolabs/oapp-evm/contracts/oapp/libs/OAppOptionsType3.sol"; import { IOAppMsgInspector } from "@layerzerolabs/oapp-evm/contracts/oapp/interfaces/IOAppMsgInspector.sol"; import { OAppPreCrimeSimulator } from "@layerzerolabs/oapp-evm/contracts/precrime/OAppPreCrimeSimulator.sol"; import { IOFT, SendParam, OFTLimit, OFTReceipt, OFTFeeDetail, MessagingReceipt, MessagingFee } from "./interfaces/IOFT.sol"; import { OFTMsgCodec } from "./libs/OFTMsgCodec.sol"; import { OFTComposeMsgCodec } from "./libs/OFTComposeMsgCodec.sol"; /** * @title OFTCore * @dev Abstract contract for the OftChain (OFT) token. */ abstract contract OFTCore is IOFT, OApp, OAppPreCrimeSimulator, OAppOptionsType3 { using OFTMsgCodec for bytes; using OFTMsgCodec for bytes32; // @notice Provides a conversion rate when swapping between denominations of SD and LD // - shareDecimals == SD == shared Decimals // - localDecimals == LD == local decimals // @dev Considers that tokens have different decimal amounts on various chains. // @dev eg. // For a token // - locally with 4 decimals --> 1.2345 => uint(12345) // - remotely with 2 decimals --> 1.23 => uint(123) // - The conversion rate would be 10 ** (4 - 2) = 100 // @dev If you want to send 1.2345 -> (uint 12345), you CANNOT represent that value on the remote, // you can only display 1.23 -> uint(123). // @dev To preserve the dust that would otherwise be lost on that conversion, // we need to unify a denomination that can be represented on ALL chains inside of the OFT mesh uint256 public immutable decimalConversionRate; // @notice Msg types that are used to identify the various OFT operations. // @dev This can be extended in child contracts for non-default oft operations // @dev These values are used in things like combineOptions() in OAppOptionsType3.sol. uint16 public constant SEND = 1; uint16 public constant SEND_AND_CALL = 2; // Address of an optional contract to inspect both 'message' and 'options' address public msgInspector; event MsgInspectorSet(address inspector); /** * @dev Constructor. * @param _localDecimals The decimals of the token on the local chain (this chain). * @param _endpoint The address of the LayerZero endpoint. * @param _delegate The delegate capable of making OApp configurations inside of the endpoint. */ constructor(uint8 _localDecimals, address _endpoint, address _delegate) OApp(_endpoint, _delegate) { if (_localDecimals < sharedDecimals()) revert InvalidLocalDecimals(); decimalConversionRate = 10 ** (_localDecimals - sharedDecimals()); } /** * @notice Retrieves interfaceID and the version of the OFT. * @return interfaceId The interface ID. * @return version The version. * * @dev interfaceId: This specific interface ID is '0x02e49c2c'. * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs. * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1) */ function oftVersion() external pure virtual returns (bytes4 interfaceId, uint64 version) { return (type(IOFT).interfaceId, 1); } /** * @dev Retrieves the shared decimals of the OFT. * @return The shared decimals of the OFT. * * @dev Sets an implicit cap on the amount of tokens, over uint64.max() will need some sort of outbound cap / totalSupply cap * Lowest common decimal denominator between chains. * Defaults to 6 decimal places to provide up to 18,446,744,073,709.551615 units (max uint64). * For tokens exceeding this totalSupply(), they will need to override the sharedDecimals function with something smaller. * ie. 4 sharedDecimals would be 1,844,674,407,370,955.1615 */ function sharedDecimals() public view virtual returns (uint8) { return 6; } /** * @dev Sets the message inspector address for the OFT. * @param _msgInspector The address of the message inspector. * * @dev This is an optional contract that can be used to inspect both 'message' and 'options'. * @dev Set it to address(0) to disable it, or set it to a contract address to enable it. */ function setMsgInspector(address _msgInspector) public virtual onlyOwner { msgInspector = _msgInspector; emit MsgInspectorSet(_msgInspector); } /** * @notice Provides a quote for OFT-related operations. * @param _sendParam The parameters for the send operation. * @return oftLimit The OFT limit information. * @return oftFeeDetails The details of OFT fees. * @return oftReceipt The OFT receipt information. */ function quoteOFT( SendParam calldata _sendParam ) external view virtual returns (OFTLimit memory oftLimit, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory oftReceipt) { uint256 minAmountLD = 0; // Unused in the default implementation. uint256 maxAmountLD = type(uint64).max; // Unused in the default implementation. oftLimit = OFTLimit(minAmountLD, maxAmountLD); // Unused in the default implementation; reserved for future complex fee details. oftFeeDetails = new OFTFeeDetail[](0); // @dev This is the same as the send() operation, but without the actual send. // - amountSentLD is the amount in local decimals that would be sent from the sender. // - amountReceivedLD is the amount in local decimals that will be credited to the recipient on the remote OFT instance. // @dev The amountSentLD MIGHT not equal the amount the user actually receives. HOWEVER, the default does. (uint256 amountSentLD, uint256 amountReceivedLD) = _debitView( _sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid ); oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD); } /** * @notice Provides a quote for the send() operation. * @param _sendParam The parameters for the send() operation. * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token. * @return msgFee The calculated LayerZero messaging fee from the send() operation. * * @dev MessagingFee: LayerZero msg fee * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. */ function quoteSend( SendParam calldata _sendParam, bool _payInLzToken ) external view virtual returns (MessagingFee memory msgFee) { // @dev mock the amount to receive, this is the same operation used in the send(). // The quote is as similar as possible to the actual send() operation. (, uint256 amountReceivedLD) = _debitView(_sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid); // @dev Builds the options and OFT message to quote in the endpoint. (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD); // @dev Calculates the LayerZero fee for the send() operation. return _quote(_sendParam.dstEid, message, options, _payInLzToken); } /** * @dev Executes the send operation. * @param _sendParam The parameters for the send operation. * @param _fee The calculated fee for the send() operation. * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. * @param _refundAddress The address to receive any excess funds. * @return msgReceipt The receipt for the send operation. * @return oftReceipt The OFT receipt information. * * @dev MessagingReceipt: LayerZero msg receipt * - guid: The unique identifier for the sent message. * - nonce: The nonce of the sent message. * - fee: The LayerZero fee incurred for the message. */ function send( SendParam calldata _sendParam, MessagingFee calldata _fee, address _refundAddress ) external payable virtual returns (MessagingReceipt memory msgReceipt, OFTReceipt memory oftReceipt) { // @dev Applies the token transfers regarding this send() operation. // - amountSentLD is the amount in local decimals that was ACTUALLY sent/debited from the sender. // - amountReceivedLD is the amount in local decimals that will be received/credited to the recipient on the remote OFT instance. (uint256 amountSentLD, uint256 amountReceivedLD) = _debit( msg.sender, _sendParam.amountLD, _sendParam.minAmountLD, _sendParam.dstEid ); // @dev Builds the options and OFT message to quote in the endpoint. (bytes memory message, bytes memory options) = _buildMsgAndOptions(_sendParam, amountReceivedLD); // @dev Sends the message to the LayerZero endpoint and returns the LayerZero msg receipt. msgReceipt = _lzSend(_sendParam.dstEid, message, options, _fee, _refundAddress); // @dev Formulate the OFT receipt. oftReceipt = OFTReceipt(amountSentLD, amountReceivedLD); emit OFTSent(msgReceipt.guid, _sendParam.dstEid, msg.sender, amountSentLD, amountReceivedLD); } /** * @dev Internal function to build the message and options. * @param _sendParam The parameters for the send() operation. * @param _amountLD The amount in local decimals. * @return message The encoded message. * @return options The encoded options. */ function _buildMsgAndOptions( SendParam calldata _sendParam, uint256 _amountLD ) internal view virtual returns (bytes memory message, bytes memory options) { bool hasCompose; // @dev This generated message has the msg.sender encoded into the payload so the remote knows who the caller is. (message, hasCompose) = OFTMsgCodec.encode( _sendParam.to, _toSD(_amountLD), // @dev Must be include a non empty bytes if you want to compose, EVEN if you dont need it on the remote. // EVEN if you dont require an arbitrary payload to be sent... eg. '0x01' _sendParam.composeMsg ); // @dev Change the msg type depending if its composed or not. uint16 msgType = hasCompose ? SEND_AND_CALL : SEND; // @dev Combine the callers _extraOptions with the enforced options via the OAppOptionsType3. options = combineOptions(_sendParam.dstEid, msgType, _sendParam.extraOptions); // @dev Optionally inspect the message and options depending if the OApp owner has set a msg inspector. // @dev If it fails inspection, needs to revert in the implementation. ie. does not rely on return boolean address inspector = msgInspector; // caches the msgInspector to avoid potential double storage read if (inspector != address(0)) IOAppMsgInspector(inspector).inspect(message, options); } /** * @dev Internal function to handle the receive on the LayerZero endpoint. * @param _origin The origin information. * - srcEid: The source chain endpoint ID. * - sender: The sender address from the src chain. * - nonce: The nonce of the LayerZero message. * @param _guid The unique identifier for the received LayerZero message. * @param _message The encoded message. * @dev _executor The address of the executor. * @dev _extraData Additional data. */ function _lzReceive( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address /*_executor*/, // @dev unused in the default implementation. bytes calldata /*_extraData*/ // @dev unused in the default implementation. ) internal virtual override { // @dev The src sending chain doesnt know the address length on this chain (potentially non-evm) // Thus everything is bytes32() encoded in flight. address toAddress = _message.sendTo().bytes32ToAddress(); // @dev Credit the amountLD to the recipient and return the ACTUAL amount the recipient received in local decimals uint256 amountReceivedLD = _credit(toAddress, _toLD(_message.amountSD()), _origin.srcEid); if (_message.isComposed()) { // @dev Proprietary composeMsg format for the OFT. bytes memory composeMsg = OFTComposeMsgCodec.encode( _origin.nonce, _origin.srcEid, amountReceivedLD, _message.composeMsg() ); // @dev Stores the lzCompose payload that will be executed in a separate tx. // Standardizes functionality for executing arbitrary contract invocation on some non-evm chains. // @dev The off-chain executor will listen and process the msg based on the src-chain-callers compose options passed. // @dev The index is used when a OApp needs to compose multiple msgs on lzReceive. // For default OFT implementation there is only 1 compose msg per lzReceive, thus its always 0. endpoint.sendCompose(toAddress, _guid, 0 /* the index of the composed message*/, composeMsg); } emit OFTReceived(_guid, _origin.srcEid, toAddress, amountReceivedLD); } /** * @dev Internal function to handle the OAppPreCrimeSimulator simulated receive. * @param _origin The origin information. * - srcEid: The source chain endpoint ID. * - sender: The sender address from the src chain. * - nonce: The nonce of the LayerZero message. * @param _guid The unique identifier for the received LayerZero message. * @param _message The LayerZero message. * @param _executor The address of the off-chain executor. * @param _extraData Arbitrary data passed by the msg executor. * * @dev Enables the preCrime simulator to mock sending lzReceive() messages, * routes the msg down from the OAppPreCrimeSimulator, and back up to the OAppReceiver. */ function _lzReceiveSimulate( Origin calldata _origin, bytes32 _guid, bytes calldata _message, address _executor, bytes calldata _extraData ) internal virtual override { _lzReceive(_origin, _guid, _message, _executor, _extraData); } /** * @dev Check if the peer is considered 'trusted' by the OApp. * @param _eid The endpoint ID to check. * @param _peer The peer to check. * @return Whether the peer passed is considered 'trusted' by the OApp. * * @dev Enables OAppPreCrimeSimulator to check whether a potential Inbound Packet is from a trusted source. */ function isPeer(uint32 _eid, bytes32 _peer) public view virtual override returns (bool) { return peers[_eid] == _peer; } /** * @dev Internal function to remove dust from the given local decimal amount. * @param _amountLD The amount in local decimals. * @return amountLD The amount after removing dust. * * @dev Prevents the loss of dust when moving amounts between chains with different decimals. * @dev eg. uint(123) with a conversion rate of 100 becomes uint(100). */ function _removeDust(uint256 _amountLD) internal view virtual returns (uint256 amountLD) { return (_amountLD / decimalConversionRate) * decimalConversionRate; } /** * @dev Internal function to convert an amount from shared decimals into local decimals. * @param _amountSD The amount in shared decimals. * @return amountLD The amount in local decimals. */ function _toLD(uint64 _amountSD) internal view virtual returns (uint256 amountLD) { return _amountSD * decimalConversionRate; } /** * @dev Internal function to convert an amount from local decimals into shared decimals. * @param _amountLD The amount in local decimals. * @return amountSD The amount in shared decimals. */ function _toSD(uint256 _amountLD) internal view virtual returns (uint64 amountSD) { return uint64(_amountLD / decimalConversionRate); } /** * @dev Internal function to mock the amount mutation from a OFT debit() operation. * @param _amountLD The amount to send in local decimals. * @param _minAmountLD The minimum amount to send in local decimals. * @dev _dstEid The destination endpoint ID. * @return amountSentLD The amount sent, in local decimals. * @return amountReceivedLD The amount to be received on the remote chain, in local decimals. * * @dev This is where things like fees would be calculated and deducted from the amount to be received on the remote. */ function _debitView( uint256 _amountLD, uint256 _minAmountLD, uint32 /*_dstEid*/ ) internal view virtual returns (uint256 amountSentLD, uint256 amountReceivedLD) { // @dev Remove the dust so nothing is lost on the conversion between chains with different decimals for the token. amountSentLD = _removeDust(_amountLD); // @dev The amount to send is the same as amount received in the default implementation. amountReceivedLD = amountSentLD; // @dev Check for slippage. if (amountReceivedLD < _minAmountLD) { revert SlippageExceeded(amountReceivedLD, _minAmountLD); } } /** * @dev Internal function to perform a debit operation. * @param _from The address to debit. * @param _amountLD The amount to send in local decimals. * @param _minAmountLD The minimum amount to send in local decimals. * @param _dstEid The destination endpoint ID. * @return amountSentLD The amount sent in local decimals. * @return amountReceivedLD The amount received in local decimals on the remote. * * @dev Defined here but are intended to be overriden depending on the OFT implementation. * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD. */ function _debit( address _from, uint256 _amountLD, uint256 _minAmountLD, uint32 _dstEid ) internal virtual returns (uint256 amountSentLD, uint256 amountReceivedLD); /** * @dev Internal function to perform a credit operation. * @param _to The address to credit. * @param _amountLD The amount to credit in local decimals. * @param _srcEid The source endpoint ID. * @return amountReceivedLD The amount ACTUALLY received in local decimals. * * @dev Defined here but are intended to be overriden depending on the OFT implementation. * @dev Depending on OFT implementation the _amountLD could differ from the amountReceivedLD. */ function _credit( address _to, uint256 _amountLD, uint32 _srcEid ) internal virtual returns (uint256 amountReceivedLD); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import { MessagingReceipt, MessagingFee } from "@layerzerolabs/oapp-evm/contracts/oapp/OAppSender.sol"; /** * @dev Struct representing token parameters for the OFT send() operation. */ struct SendParam { uint32 dstEid; // Destination endpoint ID. bytes32 to; // Recipient address. uint256 amountLD; // Amount to send in local decimals. uint256 minAmountLD; // Minimum amount to send in local decimals. bytes extraOptions; // Additional options supplied by the caller to be used in the LayerZero message. bytes composeMsg; // The composed message for the send() operation. bytes oftCmd; // The OFT command to be executed, unused in default OFT implementations. } /** * @dev Struct representing OFT limit information. * @dev These amounts can change dynamically and are up the specific oft implementation. */ struct OFTLimit { uint256 minAmountLD; // Minimum amount in local decimals that can be sent to the recipient. uint256 maxAmountLD; // Maximum amount in local decimals that can be sent to the recipient. } /** * @dev Struct representing OFT receipt information. */ struct OFTReceipt { uint256 amountSentLD; // Amount of tokens ACTUALLY debited from the sender in local decimals. // @dev In non-default implementations, the amountReceivedLD COULD differ from this value. uint256 amountReceivedLD; // Amount of tokens to be received on the remote side. } /** * @dev Struct representing OFT fee details. * @dev Future proof mechanism to provide a standardized way to communicate fees to things like a UI. */ struct OFTFeeDetail { int256 feeAmountLD; // Amount of the fee in local decimals. string description; // Description of the fee. } /** * @title IOFT * @dev Interface for the OftChain (OFT) token. * @dev Does not inherit ERC20 to accommodate usage by OFTAdapter as well. * @dev This specific interface ID is '0x02e49c2c'. */ interface IOFT { // Custom error messages error InvalidLocalDecimals(); error SlippageExceeded(uint256 amountLD, uint256 minAmountLD); // Events event OFTSent( bytes32 indexed guid, // GUID of the OFT message. uint32 dstEid, // Destination Endpoint ID. address indexed fromAddress, // Address of the sender on the src chain. uint256 amountSentLD, // Amount of tokens sent in local decimals. uint256 amountReceivedLD // Amount of tokens received in local decimals. ); event OFTReceived( bytes32 indexed guid, // GUID of the OFT message. uint32 srcEid, // Source Endpoint ID. address indexed toAddress, // Address of the recipient on the dst chain. uint256 amountReceivedLD // Amount of tokens received in local decimals. ); /** * @notice Retrieves interfaceID and the version of the OFT. * @return interfaceId The interface ID. * @return version The version. * * @dev interfaceId: This specific interface ID is '0x02e49c2c'. * @dev version: Indicates a cross-chain compatible msg encoding with other OFTs. * @dev If a new feature is added to the OFT cross-chain msg encoding, the version will be incremented. * ie. localOFT version(x,1) CAN send messages to remoteOFT version(x,1) */ function oftVersion() external view returns (bytes4 interfaceId, uint64 version); /** * @notice Retrieves the address of the token associated with the OFT. * @return token The address of the ERC20 token implementation. */ function token() external view returns (address); /** * @notice Indicates whether the OFT contract requires approval of the 'token()' to send. * @return requiresApproval Needs approval of the underlying token implementation. * * @dev Allows things like wallet implementers to determine integration requirements, * without understanding the underlying token implementation. */ function approvalRequired() external view returns (bool); /** * @notice Retrieves the shared decimals of the OFT. * @return sharedDecimals The shared decimals of the OFT. */ function sharedDecimals() external view returns (uint8); /** * @notice Provides a quote for OFT-related operations. * @param _sendParam The parameters for the send operation. * @return limit The OFT limit information. * @return oftFeeDetails The details of OFT fees. * @return receipt The OFT receipt information. */ function quoteOFT( SendParam calldata _sendParam ) external view returns (OFTLimit memory, OFTFeeDetail[] memory oftFeeDetails, OFTReceipt memory); /** * @notice Provides a quote for the send() operation. * @param _sendParam The parameters for the send() operation. * @param _payInLzToken Flag indicating whether the caller is paying in the LZ token. * @return fee The calculated LayerZero messaging fee from the send() operation. * * @dev MessagingFee: LayerZero msg fee * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. */ function quoteSend(SendParam calldata _sendParam, bool _payInLzToken) external view returns (MessagingFee memory); /** * @notice Executes the send() operation. * @param _sendParam The parameters for the send operation. * @param _fee The fee information supplied by the caller. * - nativeFee: The native fee. * - lzTokenFee: The lzToken fee. * @param _refundAddress The address to receive any excess funds from fees etc. on the src. * @return receipt The LayerZero messaging receipt from the send() operation. * @return oftReceipt The OFT receipt information. * * @dev MessagingReceipt: LayerZero msg receipt * - guid: The unique identifier for the sent message. * - nonce: The nonce of the sent message. * - fee: The LayerZero fee incurred for the message. */ function send( SendParam calldata _sendParam, MessagingFee calldata _fee, address _refundAddress ) external payable returns (MessagingReceipt memory, OFTReceipt memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; library OFTComposeMsgCodec { // Offset constants for decoding composed messages uint8 private constant NONCE_OFFSET = 8; uint8 private constant SRC_EID_OFFSET = 12; uint8 private constant AMOUNT_LD_OFFSET = 44; uint8 private constant COMPOSE_FROM_OFFSET = 76; /** * @dev Encodes a OFT composed message. * @param _nonce The nonce value. * @param _srcEid The source endpoint ID. * @param _amountLD The amount in local decimals. * @param _composeMsg The composed message. * @return _msg The encoded Composed message. */ function encode( uint64 _nonce, uint32 _srcEid, uint256 _amountLD, bytes memory _composeMsg // 0x[composeFrom][composeMsg] ) internal pure returns (bytes memory _msg) { _msg = abi.encodePacked(_nonce, _srcEid, _amountLD, _composeMsg); } /** * @dev Retrieves the nonce for the composed message. * @param _msg The message. * @return The nonce value. */ function nonce(bytes calldata _msg) internal pure returns (uint64) { return uint64(bytes8(_msg[:NONCE_OFFSET])); } /** * @dev Retrieves the source endpoint ID for the composed message. * @param _msg The message. * @return The source endpoint ID. */ function srcEid(bytes calldata _msg) internal pure returns (uint32) { return uint32(bytes4(_msg[NONCE_OFFSET:SRC_EID_OFFSET])); } /** * @dev Retrieves the amount in local decimals from the composed message. * @param _msg The message. * @return The amount in local decimals. */ function amountLD(bytes calldata _msg) internal pure returns (uint256) { return uint256(bytes32(_msg[SRC_EID_OFFSET:AMOUNT_LD_OFFSET])); } /** * @dev Retrieves the composeFrom value from the composed message. * @param _msg The message. * @return The composeFrom value. */ function composeFrom(bytes calldata _msg) internal pure returns (bytes32) { return bytes32(_msg[AMOUNT_LD_OFFSET:COMPOSE_FROM_OFFSET]); } /** * @dev Retrieves the composed message. * @param _msg The message. * @return The composed message. */ function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) { return _msg[COMPOSE_FROM_OFFSET:]; } /** * @dev Converts an address to bytes32. * @param _addr The address to convert. * @return The bytes32 representation of the address. */ function addressToBytes32(address _addr) internal pure returns (bytes32) { return bytes32(uint256(uint160(_addr))); } /** * @dev Converts bytes32 to an address. * @param _b The bytes32 value to convert. * @return The address representation of bytes32. */ function bytes32ToAddress(bytes32 _b) internal pure returns (address) { return address(uint160(uint256(_b))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; library OFTMsgCodec { // Offset constants for encoding and decoding OFT messages uint8 private constant SEND_TO_OFFSET = 32; uint8 private constant SEND_AMOUNT_SD_OFFSET = 40; /** * @dev Encodes an OFT LayerZero message. * @param _sendTo The recipient address. * @param _amountShared The amount in shared decimals. * @param _composeMsg The composed message. * @return _msg The encoded message. * @return hasCompose A boolean indicating whether the message has a composed payload. */ function encode( bytes32 _sendTo, uint64 _amountShared, bytes memory _composeMsg ) internal view returns (bytes memory _msg, bool hasCompose) { hasCompose = _composeMsg.length > 0; // @dev Remote chains will want to know the composed function caller ie. msg.sender on the src. _msg = hasCompose ? abi.encodePacked(_sendTo, _amountShared, addressToBytes32(msg.sender), _composeMsg) : abi.encodePacked(_sendTo, _amountShared); } /** * @dev Checks if the OFT message is composed. * @param _msg The OFT message. * @return A boolean indicating whether the message is composed. */ function isComposed(bytes calldata _msg) internal pure returns (bool) { return _msg.length > SEND_AMOUNT_SD_OFFSET; } /** * @dev Retrieves the recipient address from the OFT message. * @param _msg The OFT message. * @return The recipient address. */ function sendTo(bytes calldata _msg) internal pure returns (bytes32) { return bytes32(_msg[:SEND_TO_OFFSET]); } /** * @dev Retrieves the amount in shared decimals from the OFT message. * @param _msg The OFT message. * @return The amount in shared decimals. */ function amountSD(bytes calldata _msg) internal pure returns (uint64) { return uint64(bytes8(_msg[SEND_TO_OFFSET:SEND_AMOUNT_SD_OFFSET])); } /** * @dev Retrieves the composed message from the OFT message. * @param _msg The OFT message. * @return The composed message. */ function composeMsg(bytes calldata _msg) internal pure returns (bytes memory) { return _msg[SEND_AMOUNT_SD_OFFSET:]; } /** * @dev Converts an address to bytes32. * @param _addr The address to convert. * @return The bytes32 representation of the address. */ function addressToBytes32(address _addr) internal pure returns (bytes32) { return bytes32(uint256(uint160(_addr))); } /** * @dev Converts bytes32 to an address. * @param _b The bytes32 value to convert. * @return The address representation of bytes32. */ function bytes32ToAddress(bytes32 _b) internal pure returns (address) { return address(uint160(uint256(_b))); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 value) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets a `value` amount of tokens as the allowance of `spender` over the * caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; import {IERC20Permit} from "../extensions/IERC20Permit.sol"; import {Address} from "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev An operation with an ERC20 token failed. */ error SafeERC20FailedOperation(address token); /** * @dev Indicates a failed `decreaseAllowance` request. */ error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease); /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value))); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value))); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); forceApprove(token, spender, oldAllowance + value); } /** * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no * value, non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal { unchecked { uint256 currentAllowance = token.allowance(address(this), spender); if (currentAllowance < requestedDecrease) { revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease); } forceApprove(token, spender, currentAllowance - requestedDecrease); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value)); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0))); _callOptionalReturn(token, approvalCall); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data); if (returndata.length != 0 && !abi.decode(returndata, (bool))) { revert SafeERC20FailedOperation(address(token)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol) pragma solidity ^0.8.20; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev The ETH balance of the account is not enough to perform the operation. */ error AddressInsufficientBalance(address account); /** * @dev There's no code at `target` (it is not a contract). */ error AddressEmptyCode(address target); /** * @dev A call to an address target failed. The target may have reverted. */ error FailedInnerCall(); /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { if (address(this).balance < amount) { revert AddressInsufficientBalance(address(this)); } (bool success, ) = recipient.call{value: amount}(""); if (!success) { revert FailedInnerCall(); } } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason or custom error, it is bubbled * up by this function (like regular Solidity function calls). However, if * the call reverted with no returned reason, this function reverts with a * {FailedInnerCall} error. * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { if (address(this).balance < value) { revert AddressInsufficientBalance(address(this)); } (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an * unsuccessful call. */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata ) internal view returns (bytes memory) { if (!success) { _revert(returndata); } else { // only check if target is a contract if the call was successful and the return data is empty // otherwise we already know that it was a contract if (returndata.length == 0 && target.code.length == 0) { revert AddressEmptyCode(target); } return returndata; } } /** * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the * revert reason or with a default {FailedInnerCall} error. */ function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) { if (!success) { _revert(returndata); } else { return returndata; } } /** * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}. */ function _revert(bytes memory returndata) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert FailedInnerCall(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
{ "detectMissingLibraries": false, "enableEraVMExtensions": false, "evmVersion": "shanghai", "forceEVMLA": false, "libraries": {}, "metadata": {}, "optimizer": { "disable_system_request_memoization": true, "enabled": true, "fallback_to_optimizing_for_size": false, "mode": "3" }, "outputSelection": { "*": { "*": [ "abi" ] } }, "remappings": [ "ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/", "forge-std/=node_modules/@layerzerolabs/toolbox-foundry/lib/forge-std/", "@layerzerolabs/=node_modules/@layerzerolabs/", "@openzeppelin/=node_modules/@openzeppelin/", "dn404-adjustable/=lib/dn404-adjustable/src/", "solady/=lib/dn404-adjustable/lib/solady/src/", "hardhat-deploy/=node_modules/hardhat-deploy/", "hardhat/=node_modules/hardhat/", "murky/=lib/dn404-adjustable/lib/murky/", "openzeppelin-contracts/=lib/dn404-adjustable/lib/murky/lib/openzeppelin-contracts/", "solidity-bytes-utils/=node_modules/solidity-bytes-utils/" ], "viaIR": false }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint96","name":"_tokensPerNft","type":"uint96"},{"internalType":"address","name":"_lzEndpoint","type":"address"},{"internalType":"address","name":"_delegate","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"DNAlreadyInitialized","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InsufficientAllowance","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidDelegate","type":"error"},{"inputs":[],"name":"InvalidEndpointCall","type":"error"},{"inputs":[],"name":"InvalidLocalDecimals","type":"error"},{"inputs":[{"internalType":"bytes","name":"options","type":"bytes"}],"name":"InvalidOptions","type":"error"},{"inputs":[],"name":"LinkMirrorContractFailed","type":"error"},{"inputs":[],"name":"LzTokenUnavailable","type":"error"},{"inputs":[],"name":"MirrorAddressIsZero","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"NoPeer","type":"error"},{"inputs":[{"internalType":"uint256","name":"msgValue","type":"uint256"}],"name":"NotEnoughNative","type":"error"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"OnlyEndpoint","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"OnlyPeer","type":"error"},{"inputs":[],"name":"OnlySelf","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SenderNotMirror","type":"error"},{"inputs":[{"internalType":"bytes","name":"result","type":"bytes"}],"name":"SimulationResult","type":"error"},{"inputs":[{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"}],"name":"SlippageExceeded","type":"error"},{"inputs":[],"name":"TokenDoesNotExist","type":"error"},{"inputs":[],"name":"TotalSupplyOverflow","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"ZeroTokensPerNft","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"indexed":false,"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"EnforcedOptionSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"inspector","type":"address"}],"name":"MsgInspectorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"dstEid","type":"uint32"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"name":"OFTSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"peer","type":"bytes32"}],"name":"PeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"preCrimeAddress","type":"address"}],"name":"PreCrimeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"SkipNFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"SEND","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEND_AND_CALL","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"}],"name":"allowInitializePath","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvalRequired","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint16","name":"_msgType","type":"uint16"},{"internalType":"bytes","name":"_extraOptions","type":"bytes"}],"name":"combineOptions","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalConversionRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"contract ILayerZeroEndpointV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"}],"name":"enforcedOptions","outputs":[{"internalType":"bytes","name":"enforcedOption","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"a","type":"address"}],"name":"getSkipNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"","type":"tuple"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"address","name":"_sender","type":"address"}],"name":"isComposeMsgSender","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"isPeer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"origin","type":"tuple"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"address","name":"executor","type":"address"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct InboundPacket[]","name":"_packets","type":"tuple[]"}],"name":"lzReceiveAndRevert","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceiveSimulate","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mirror","outputs":[{"internalType":"contract DN404Mirror","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mirrorERC721","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"msgInspector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oApp","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oAppVersion","outputs":[{"internalType":"uint64","name":"senderVersion","type":"uint64"},{"internalType":"uint64","name":"receiverVersion","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"oftVersion","outputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"},{"internalType":"uint64","name":"version","type":"uint64"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"peers","outputs":[{"internalType":"bytes32","name":"peer","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"preCrime","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"}],"name":"quoteOFT","outputs":[{"components":[{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"uint256","name":"maxAmountLD","type":"uint256"}],"internalType":"struct OFTLimit","name":"oftLimit","type":"tuple"},{"components":[{"internalType":"int256","name":"feeAmountLD","type":"int256"},{"internalType":"string","name":"description","type":"string"}],"internalType":"struct OFTFeeDetail[]","name":"oftFeeDetails","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"internalType":"bool","name":"_payInLzToken","type":"bool"}],"name":"quoteSend","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"msgFee","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint256","name":"amountLD","type":"uint256"},{"internalType":"uint256","name":"minAmountLD","type":"uint256"},{"internalType":"bytes","name":"extraOptions","type":"bytes"},{"internalType":"bytes","name":"composeMsg","type":"bytes"},{"internalType":"bytes","name":"oftCmd","type":"bytes"}],"internalType":"struct SendParam","name":"_sendParam","type":"tuple"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"_fee","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"msgReceipt","type":"tuple"},{"components":[{"internalType":"uint256","name":"amountSentLD","type":"uint256"},{"internalType":"uint256","name":"amountReceivedLD","type":"uint256"}],"internalType":"struct OFTReceipt","name":"oftReceipt","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint16","name":"msgType","type":"uint16"},{"internalType":"bytes","name":"options","type":"bytes"}],"internalType":"struct EnforcedOptionParam[]","name":"_enforcedOptions","type":"tuple[]"}],"name":"setEnforcedOptions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_msgInspector","type":"address"}],"name":"setMsgInspector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"bytes32","name":"_peer","type":"bytes32"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_preCrime","type":"address"}],"name":"setPreCrime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"skipNFT","type":"bool"}],"name":"setSkipNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sharedDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"result","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
00000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000d07c30af3ff30d96bdc9c6044958230eb797ddbf00000000000000000000000021af1185734d213d45c6236146fb81e2b0e8b821
Deployed Bytecode
0x000400000000000200170000000000020000000003020019000000000801034f00000000010800190000006001100270000008fa0210019700030000002803550002000000080355000008fa0010019d0000000100300190000000690000c13d0000008003000039000000400030043f000000040020008c000000a20000413d000000000108043b000000e0011002700000091d0010009c000000a60000213d0000093d0010009c000000f80000213d0000094d0010009c000001b20000213d000009550010009c0000024a0000213d000009590010009c0000068a0000613d0000095a0010009c000004eb0000613d0000095b0010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000009070010009c00001a860000213d00000004011000390000000002120049000009850020009c00001a860000213d000000e00020008c00001a860000413d000000800000043f000000a00000043f000000c00000043f000000e00000043f000001000000043f0000090702000041000001200020043f0000016002000039000000400020043f000000000218034f000001400000043f000000000202043b000008fa0020009c00001a860000213d0000006002100039000000000228034f0000004001100039000000000118034f000000000101043b001200000001001d000000000102043b001300000001001d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b000009aa0000613d00000012031000f900000000021300a9000000120010006c0000005e0000213d00000000033200d9000000000013004b000015cd0000c13d000000400100043d000000130020006c00000f7d0000813d000000240310003900000013040000290000000000430435000009980300004100000000003104350000000403100039000000000023043500000f040000013d0000000001000416000000000001004b00001a860000c13d0000001f01200039000008fb01100197000000e001100039000000400010043f0000001f0320018f000008fc04200198000000e0014000390000007a0000613d000000e005000039000000000608034f000000006706043c0000000005750436000000000015004b000000760000c13d000000000003004b000000870000613d000000000448034f0000000303300210000000000501043300000000053501cf000000000535022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000353019f0000000000310435000000600020008c00001a860000413d000000e00200043d000008fd0020009c00001a860000213d000001000300043d000008fe0030009c00001a860000213d000001200100043d001300000001001d000008fe0010009c00001a860000213d000008ff01000041000000800010043f0000001306000029000000000006004b0000047f0000c13d000000400100043d0000091c02000041000000000021043500000004021000390000000000020435000008fa0010009c000008fa01008041000000400110021000000906011001c7000023e500010430000000000002004b000000bc0000c13d0000000001000019000023e40001042e0000091e0010009c000001360000213d0000092e0010009c000001c30000213d000009360010009c000002570000213d0000093a0010009c000006930000613d0000093b0010009c000005310000613d0000093c0010009c000000be0000c13d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fa0010009c000001ce0000a13d00001a860000013d000000000108043b000000e001100270000009b80010009c000001650000a13d000009b90010009c0000023a0000a13d000009ba0010009c000003ee0000613d000009bb0010009c000004560000613d000009bc0010009c000000a40000c13d0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000440020008c00001a860000413d0000002401800370000000000101043b001300000001001d0000000401800370000000000101043b000008fe01100197000000000010043f000009c401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001302000029000008fe02200197000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000000ff001001900000000001000039000000010100c039000000000010043f0000095f01000041000023e40001042e0000093e0010009c000001d10000213d000009460010009c000002620000213d0000094a0010009c000006a00000613d0000094b0010009c000005480000613d0000094c0010009c000000be0000c13d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fa0010009c00001a860000213d0000002401800370000000000301043b000000000100041a000008fe021001970000000001000411000000000012004b00000bef0000c13d001200000003001d0000001301000029000000000010043f0000000101000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001203000029000000000031041b000000400100043d0000002002100039000000000032043500000013020000290000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f00000968011001c70000800d020000390000000103000039000009ac04000041000005bb0000013d0000091f0010009c000002170000213d000009270010009c000002710000213d0000092b0010009c000006f40000613d0000092c0010009c0000054f0000613d0000092d0010009c000000be0000c13d000000240020008c00001a860000413d0000000401800370000000000101043b000e00000001001d000009070010009c00001a860000213d0000000e010000290000002301100039000000000021004b00001a860000813d0000000e010000290000000401100039000000000118034f000000000101043b000d00000001001d000009070010009c00001a860000213d0000000e01000029001200240010003d0000000d0100002900000005011002100000001201100029000000000021004b00001a860000213d0000000d0000006b00000cab0000c13d000000800a0000390000099c0100004100000000001a043500000000010004140000000002000411000000040020008c00000e350000c13d0000000301000367000000010300003100000e480000013d000009bf0010009c000002320000213d000009c20010009c000003840000613d000009c30010009c000000a40000c13d0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000240020008c00001a860000413d0000000401800370000000000101043b001300000001001d00000002011002700000097901100197001200000001001d000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000013020000290000000602200210001300c000200193000000000101043b000000000101041a0000001301100250000008fa01100197000000000010043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000008fe00100198000003b40000613d0000001201000029000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a0000001301100250000008fa01100197000000000010043f0000097401000041000000200010043f000000000100041400000c1c0000013d0000094e0010009c000002ca0000213d000009520010009c000007060000613d000009530010009c0000056a0000613d000009540010009c000000be0000c13d0000000001000416000000000001004b00001a860000c13d0000091301000041000000000101041a000008fd01100197000000800010043f0000095c01000041000023e40001042e0000092f0010009c000002fa0000213d000009330010009c0000070f0000613d000009340010009c000005730000613d000009350010009c000000be0000c13d0000000001000416000000000001004b00001a860000c13d000000800000043f0000095c01000041000023e40001042e0000093f0010009c000003420000213d000009430010009c000004780000613d000009440010009c000005830000613d000009450010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000301043b000009070030009c00001a860000213d0000002301300039000000000021004b00001a860000813d0000000404300039000000000148034f000000000101043b000009070010009c00001a860000213d00000024033000390000000005310019000000000025004b00001a860000213d000000000200041a000008fe052001970000000002000411000000000025004b000009f10000c13d0000000502000039000000000602041a000000010060019000000001056002700000007f0550618f0000001f0050008c00000000070000390000000107002039000000000676013f00000001006001900000063b0000c13d000000200050008c0000020f0000413d000000000020043f0000001f061000390000000506600270000009a60660009a000000200010008c00000983060040410000001f055000390000000505500270000009a60550009a000000000056004b0000020f0000813d000000000006041b0000000106600039000000000056004b0000020b0000413d0000001f0010008c00000f090000a13d000000000020043f000009cf0510019800000fbf0000c13d0000098304000041000000000600001900000fca0000013d000009200010009c000003650000213d000009240010009c000007230000613d000009250010009c0000059f0000613d000009260010009c000000be0000c13d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fe0010009c00001a860000213d0000002402800370000000000202043b001300000002001d000008fe0020009c00001a860000213d23e31cd90000040f000000130200002923e31cfb0000040f000000000101041a000009d50000013d000009c00010009c000003bc0000613d000009c10010009c000000a40000c13d0000000101000039000000000010043f0000095f01000041000023e40001042e000009bd0010009c000004040000613d000009be0010009c000000a40000c13d0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000040020008c00001a860000413d0000090d01000041000000000101041a000000a001100270000004700000013d000009560010009c000009030000613d000009570010009c000005bf0000613d000009580010009c000000be0000c13d0000000001000416000000000001004b00001a860000c13d0000000201000039000000800010043f0000095c01000041000023e40001042e000009370010009c0000090c0000613d000009380010009c0000061f0000613d000009390010009c000000be0000c13d0000000001000416000000000001004b00001a860000c13d000000000100041a000009080000013d000009470010009c000009270000613d000009480010009c000006260000613d000009490010009c000000be0000c13d0000000001000416000000000001004b00001a860000c13d0000091301000041000000000101041a0000006001100270000000800010043f0000095c01000041000023e40001042e000009280010009c000009750000613d000009290010009c0000062b0000613d0000092a0010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fe0010009c00001a860000213d000000000100041a000008fe021001970000000001000411000000000012004b00000bef0000c13d0000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b00000903020000410000000000200443000008fe01100197001200000001001d00000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b00001a860000613d000000400400043d0000090501000041000000000014043500000004014000390000001302000029000000000021043500000000010004140000001202000029000000040020008c000002c40000613d000008fa0040009c000008fa0200004100000000020440190000004002200210000008fa0010009c000008fa01008041000000c001100210000000000121019f00000906011001c70000001202000029001300000004001d23e323d90000040f000000130400002900000000030100190000006003300270000108fa0030019d0003000000010355000000010020019000000fb20000613d0000000001040019000009070040009c00000f7f0000213d000000400010043f0000000001000019000023e40001042e0000094f0010009c000009b00000613d000009500010009c000006410000613d000009510010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fe0010009c00001a860000213d0000001301000029000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000009690010019800000c870000c13d00000903010000410000000000100443000000130100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000009d20000013d000009300010009c000009b70000613d000009310010009c000006770000613d000009320010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000009070010009c00001a860000213d0000002303100039000000000023004b00001a860000813d0000000403100039000000000338034f000000000403043b000009070040009c00001a860000213d001300240010003d000000050540021000000013015000290000000003010019000000000021004b00001a860000213d000000000600041a000008fe076001970000000006000411000000000067004b00000dd70000c13d0000003f055000390000099e055001970000099f0050009c00000f7f0000213d000000000108034f0000008005500039000000400050043f000000800040043f000000000004004b00000f150000c13d000000400100043d00000020020000390000000003210436000000800200043d0000000000230435000000400310003900000005042002100000000008340019000000000002004b00000f880000c13d0000000002180049000008fa0020009c000008fa020080410000006002200210000008fa0010009c000008fa010080410000004001100210000000000112019f0000000002000414000008fa0020009c000008fa02008041000000c002200210000000000121019f00000901011001c70000800d020000390000000103000039000009a204000041000005bb0000013d000009400010009c000009c60000613d000009410010009c0000067c0000613d000009420010009c000000be0000c13d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fe0010009c00001a860000213d000000000200041a000008fe032001970000000002000411000000000023004b000009f10000c13d0000000402000039000000000302041a0000090003300197000000000313019f000000000032041b000000800010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000960011001c70000800d020000390000000103000039000009a504000041000005bb0000013d000009210010009c000009dc0000613d000009220010009c000004780000613d000009230010009c000000be0000c13d000000640020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fa0010009c00001a860000213d000000000010043f0000000101000039000000200010043f0000004001000039001300000008035323e323af0000040f000000130200035f0000002402200370000000000202043b000000000101041a000000000021004b00000000010000390000000101006039000000800010043f0000095c01000041000023e40001042e0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000240020008c00001a860000413d0000000401800370000000000101043b001300000001001d00000002011002700000097901100197000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000013020000290000000602200210000000c00220018f000000000101043b000000000101041a000000000121022f000008fa01100197000000000010043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000008fe0010019800000c170000c13d000000400100043d000009cd020000410000000000210435000008fa0010009c000008fa01008041000000400110021000000910011001c7000023e5000104300000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000640020008c00001a860000413d0000000401800370000000000101043b001300000001001d0000002401800370000000000101043b001200000001001d0000004401800370000000000101043b000008fe01100197000000000010043f000009c401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001302000029000008fe02200197000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000009d002200197000000120000006b000000010220c1bf000000000021041b000002360000013d0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000840020008c00001a860000413d0000004401800370000000000201043b0000000401800370000000000401043b0000006401800370000000000301043b0000002401800370000000000101043b000008fe01100198000009f60000c13d000009cc01000041000000800010043f0000096301000041000023e5000104300000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000640020008c00001a860000413d0000000401800370000000000101043b001100000001001d0000004401800370000000000101043b001200000001001d0000002401800370000000000101043b001300000001001d00000002011002700000097901100197000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000013020000290000000602200210000000c00220018f000000000101043b000000000101041a000000000121022f000008fa01100197000000000010043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000001202000029000008fe02200197000000000101043b000000000101041a000008fe01100197000000000012004b001200000001001d00000c2a0000c13d0000001301000029000000000010043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000001102000029000008fe02200197000000000101043b000000000301041a0000090003300197000000000223019f000000000021041b0000001201000029000000000010043f0000095f01000041000023e40001042e0000091301000041000000000101041a00000060011002700000000003000411000000000013004b000004740000c13d000000240020008c00001a860000413d0000000401800370000000000101043b000008fe01100197000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a0000008001100270000008fa01100197000000000010043f0000095f01000041000023e40001042e000009ce01000041000000800010043f0000096301000041000023e5000104300000000001000416000000000001004b00001a860000c13d0000000001000410000000800010043f0000095c01000041000023e40001042e000000000100041a001100000002001d0000090002100197000000000262019f000000000020041b0000000002000414000008fe05100197000008fa0020009c000008fa02008041000000c00120021000000901011001c70000800d02000039001200000003001d0000000303000039000009020400004123e323d90000040f0000001203000029000000010020019000001a860000613d000000a00030043f0000090301000041000000000010044300000004003004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b000000120200002900001a860000613d000000400400043d0000090501000041000000000014043500000004034000390000001301000029001000000003001d00000000001304350000000001000414000000040020008c001300000004001d000004bf0000613d000008fa0040009c000008fa0300004100000000030440190000004003300210000008fa0010009c000008fa01008041000000c001100210000000000131019f00000906011001c723e323d90000040f000000130400002900000000030100190000006003300270000108fa0030019d0003000000010355000000010020019000000c890000613d000009070040009c00000f7f0000213d0000001302000029000000400020043f0000090801000041000000c00010043f000009090020009c00000f7f0000213d000000130400002900000024014000390000090a02000041000000000021043500000084014000390000000002000411000000000021043500000000010004140000090b02000041000000000024043500000010020000290000000000020435000000640240003900000020030000390000000000320435000000440240003900000060030000390000000000320435000008fa0040009c000008fa040080410000004002400210000008fa0010009c000008fa01008041000000c001100210000000000112019f0000090c011001c7000080060200003923e323d90000040f000000010020019000000e100000613d000000000101043b000000000001004b00000eb30000c13d0000000301000367000000010200003100000e150000013d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fe0010009c00001a860000213d0000002401800370000000000101043b001200000001001d0000000001000411000008fe01100197000000000010043f000009ae01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001302000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001202000029000000000021041b000000400100043d0000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d020000390000000303000039000009b6040000410000000005000411000000130600002923e323d90000040f000000010020019000001a860000613d000000400100043d00000001020000390000000000210435000008fa0010009c000008fa0100804100000040011002100000095f011001c7000023e40001042e0000000001000416000000000001004b00001a860000c13d000000000100041a000008fe051001970000000002000411000000000025004b000009f10000c13d0000090001100197000000000010041b0000000001000414000008fa0010009c000008fa01008041000000c00110021000000901011001c70000800d0200003900000003030000390000090204000041000000000600001923e323d90000040f0000000100200190000000a40000c13d00001a860000013d0000000001000416000000000001004b00001a860000c13d0000001201000039000000800010043f0000095c01000041000023e40001042e000000640020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fa0010009c00001a860000213d0000002401800370000000000101043b001200000001001d0000ffff0010008c00001a860000213d0000004401800370000000000101043b000009070010009c00001a860000213d000000040110003923e31c620000040f000000000301001900000000040200190000001301000029000000120200002923e31d220000040f000005990000013d0000000001000416000000000001004b00001a860000c13d0000000101000039000000800010043f0000000201000039000000a00010043f000009b001000041000023e40001042e0000000001000416000000000001004b00001a860000c13d0000000001000412001500000001001d001400400000003d000080050100003900000044030000390000000004000415000000150440008a0000000504400210000009640200004123e323c00000040f000000800010043f0000095c01000041000023e40001042e000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fa0010009c00001a860000213d0000002402800370000000000202043b001300000002001d0000ffff0020008c00001a860000213d000000000010043f0000000301000039000000200010043f000000400100003923e323af0000040f000000130200002923e31c7c0000040f23e31c8c0000040f0000002002000039000000400300043d001300000003001d000000000223043623e31c3b0000040f00000c6e0000013d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fe0010009c00001a860000213d000000000200041a000008fe032001970000000002000411000000000023004b000009f10000c13d0000000202000039000000000302041a0000090003300197000000000313019f000000000032041b000000800010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000960011001c70000800d020000390000000103000039000009610400004123e323d90000040f0000000100200190000000a40000c13d00001a860000013d000000e40020008c00001a860000413d0000006401800370000000000101043b001200000001001d0000008401800370000000000101043b001300000001001d000009070010009c00001a860000213d00000013010000290000002301100039000000000021004b00001a860000813d0000001301000029001000040010003d0000001001800360000000000101043b001100000001001d000009070010009c00001a860000213d00000013030000290000001101300029000f00240010003d0000000f0020006b00001a860000213d000000a401800370000000000101043b000008fe0010009c00001a860000213d000000c401800370000000000101043b000009070010009c00001a860000213d0000002303100039000000000023004b00001a860000813d0000000403100039000000000338034f000000000303043b000009070030009c00001a860000213d00000000013100190000002401100039000000000021004b00001a860000213d0000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000008fe011001970000000002000411000000000021004b000011170000c13d00000004010000390000000201100367000000000101043b000e00000001001d000008fa0010009c00001a860000213d0000000e01000029000000000010043f0000000101000039000a00000001001d000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000000000002004b000012b00000c13d000000400100043d0000099602000041000000000021043500000004021000390000000e030000290000111c0000013d0000000001000416000000000001004b00001a860000c13d0000000601000039000000800010043f0000095c01000041000023e40001042e0000000001000416000000000001004b00001a860000c13d0000000601000039000009070000013d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000505000039000000000405041a000000010640019000000001014002700000007f0110618f0000001f0010008c00000000020000390000000102002039000000000224013f000000010020019000000bea0000613d000009a101000041000000000010043f0000002201000039000000040010043f0000090601000041000023e500010430000000640020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b001300000001001d000008fe0010009c00001a860000213d0000002401800370000000000101043b001200000001001d000008fe0010009c00001a860000213d0000004401800370000000000101043b001100000001001d0000001301000029000000000010043f000009ae01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000000002000411000008fe02200197001000000002001d000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000009d10010009c00000eae0000c13d000000130100002900000012020000290000001103000029000009c30000013d0000000001000416000000000001004b00001a860000c13d0000000201000039000009070000013d0000000001000416000000000001004b00001a860000c13d0000000001000412001700000001001d001600200000003d000080050100003900000044030000390000000004000415000000170440008a0000000504400210000009640200004123e323c00000040f000009080000013d0000000001000416000000000001004b00001a860000c13d000000c001000039000000400010043f0000000c01000039000000800010043f000009b701000041000007170000013d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fe0010009c00001a860000213d23e31cea0000040f000000000101041a000000a001100270000009d50000013d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000201043b000000000002004b0000000001000039000000010100c039001300000002001d000000000012004b00001a860000c13d0000000001000411000008fe01100197000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000501043b000000000105041a0000096900100198000006d60000c13d001200000005001d00000903010000410000000000100443000000000100041100000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000001205000029000000000205041a0000096b02200197000000000112019f000000000015041b0000001304000029000000000004004b0000000002000039000000010200c0390000096e001001980000000003000039000000010300c039000000000032004b000006e10000613d0000096e01100167000000000015041b000000400100043d0000000000410435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d020000390000000203000039000009ad04000041000000000500041123e323d90000040f0000000100200190000000a40000c13d00001a860000013d000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fa0010009c00001a860000213d000000000010043f0000000101000039000000200010043f000000400100003923e323af0000040f000000000101041a000000800010043f0000095c01000041000023e40001042e0000000001000416000000000001004b00001a860000c13d000009b101000041000000800010043f0000000101000039000000a00010043f000009b001000041000023e40001042e0000000001000416000000000001004b00001a860000c13d000000c001000039000000400010043f0000000601000039000000800010043f000009a301000041000000a00010043f0000002001000039000000c00010043f0000008001000039000000e00200003923e31c3b0000040f000000c00110008a000008fa0010009c000008fa010080410000006001100210000009a4011001c7000023e40001042e000000e40020008c00001a860000413d0000006401800370000000000101043b001200000001001d0000008401800370000000000101043b001300000001001d000009070010009c00001a860000213d00000013010000290000002301100039000000000021004b00001a860000813d00000013010000290000000401100039000000000318034f000000000303043b001100000003001d000009070030009c00001a860000213d00000013040000290000001103400029000d00240030003d0000000d0020006b00001a860000213d000000a403800370000000000303043b000008fe0030009c00001a860000213d000000c403800370000000000303043b000009070030009c00001a860000213d0000002304300039000000000024004b00001a860000813d0000000404300039000000000448034f000000000404043b000009070040009c00001a860000213d00000000034300190000002403300039000000000023004b00001a860000213d00000000020004100000000003000411000000000023004b000010b30000c13d0000001102000029000000200020008c00001a860000413d0000002001100039000000000218034f000000000202043b001000000002001d0000001102000029000000280020008c00001a860000413d0000002001100039000000000118034f000000000101043b000f00000001001d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d0000000f04000029000000c002400270000000000101043b00050000002100ad000009660040009c0000077b0000413d00000005022000f9000000000012004b000015cd0000c13d00000004010000390000000201100367000000000101043b000008fa0010009c00001a860000213d0000001001000029000308fe0010019c00000003010000290000dead01006039000400000001001d000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b001000000001001d000000000101041a0000096900100198000007ac0000c13d00000903010000410000000000100443000000040100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000001003000029000000000203041a0000096b02200197000000000112019f000000000013041b00000005010000290000096c0010009c000014750000213d0000091301000041000000000101041a000008fd021001970000000502200029000f00000002001d0000096c0020009c000014750000213d0000096d011001970000000f011001af0000091302000041000000000012041b0000001003000029000000000403041a000000a0014002700000000501100029000c00000001001d000000a001100210000008fe02400197000000000121019f000000000013041b000e00000004001d0000096e004001980000080c0000c13d0000000401000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000090d02000041000000000202041a000b00000002001d000000000101043b000a00000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b0000000b020000290000004002200270000008fd02200197000b0000002100ae000009aa0000613d000000400100043d000200000001001d000009700010009c00000f7f0000213d0000000e010000290000008001100270000008fa011001970000000c030000290000000b023000fa000c00000001001d000900000002001d000000000112004b000000000100401900000002040000290000004002400039000000400020043f000000600200003900000000052404360000000000050435000000400200043d00000040032000390000000000130435000000050110021000000060022000390000000001120019000000400010043f000800000005001d000000000025043500000000003404350000000001030433000000000001004b000015c30000c13d000000400100043d00000005020000290000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d0200003900000003030000390000097e040000410000000005000019000000040600002923e323d90000040f000000010020019000001a860000613d0000001101000029000000280510008c000008e70000a13d00000002060003670000004401600370000000000101043b000009070010009c00001a860000213d0000000402600370000000000202043b000008fa0020009c00001a860000213d000009070050009c00000f7f0000213d0000001103000029000000090330008a000009cf033001970000003f03300039000009cf03300197000000400400043d0000000003340019000000000043004b00000000070000390000000107004039000009070030009c00000f7f0000213d000000010070019000000f7f0000c13d000000400030043f00000000035404360000000d08000029000000000080007c00001a860000213d00000013070000290000004c07700039000000000676034f000009cf075001980000001f0850018f00000000057300190000084e0000613d000000000906034f000000000a030019000000009b09043c000000000aba043600000000005a004b0000084a0000c13d000000000008004b0000085b0000613d000000000676034f0000000307800210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000001105400029000000080550008a0000000000050435000000c001100210000000400600043d0000002005600039001300000005001d0000000000150435000000e001200210000000280260003900000000001204350000002c0160003900000005020000290000000000210435001100000006001d0000004c026000390000000001040433000000000001004b000008760000613d000000000400001900000000052400190000000006340019000000000606043300000000006504350000002004400039000000000014004b0000086f0000413d000000000221001900000000000204350000002c02100039000000110300002900000000002304350000006b01100039000009cf021001970000000001320019000000000021004b00000000020000390000000102004039000009070010009c00000f7f0000213d000000010020019000000f7f0000c13d000000400010043f0000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b00000903020000410000000000200443000008fe01100197001000000001001d00000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b00001a860000613d000000400300043d0000006401300039000000800200003900000000002104350000002401300039000000120200002900000000002104350000097f010000410000000000130435000000040130003900000003020000290000000000210435000000440130003900000000000104350000001101000029000000000101043300000084023000390000000000120435001100000003001d000000a402300039000000000001004b000008c50000613d000000000300001900000000042300190000001305300029000000000505043300000000005404350000002003300039000000000013004b000008be0000413d0000000002210019000000000002043500000000020004140000001003000029000000040030008c000008e20000613d0000001f01100039000009cf01100197000000a401100039000008fa0010009c000008fa0100804100000060011002100000001103000029000008fa0030009c000008fa030080410000004003300210000000000131019f000008fa0020009c000008fa02008041000000c002200210000000000112019f000000100200002923e323d90000040f00000000030100190000006003300270000108fa0030019d0003000000010355000000010020019000001aaa0000613d0000001101000029000009070010009c00000f7f0000213d0000001101000029000000400010043f00000004010000390000000201100367000000000101043b000008fa0010009c00001a860000213d000000400200043d0000002003200039000000050400002900000000004304350000000000120435000008fa0020009c000008fa0200804100000040012002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f00000968011001c70000800d02000039000000030300003900000980040000410000001205000029000000030600002923e323d90000040f0000000100200190000000a40000c13d00001a860000013d0000000001000416000000000001004b00001a860000c13d0000000401000039000000000101041a000008fe01100197000000800010043f0000095c01000041000023e40001042e000000a40020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000006401800370000000000101043b000009070010009c00001a860000213d0000002303100039000000000023004b00001a860000813d0000000403100039000000000338034f000000000303043b000009070030009c00001a860000213d00000000013100190000002401100039000000000021004b00001a860000213d0000008401800370000000000101043b000008fe0010009c00001a860000213d00000000020004100000037e0000013d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000009070010009c00001a860000213d001300040010003d000000130220006a000009850020009c00001a860000213d000000e00020008c00001a860000413d0000002402800370000000000302043b000000000003004b0000000002000039000000010200c039001200000003001d000000000023004b00001a860000c13d000000c002000039000000400020043f0000006401100039000000000118034f0000001302800360000000800000043f000000a00000043f000000000101043b001100000001001d000000000102043b001000000001001d000008fa0010009c00001a860000213d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b000009aa0000613d00000013020000290000004002200039000e00000002001d0000000202200367000000000302043b00000000021300d9000f0000001200ad000000000031004b000009690000213d0000000f022000f9000000000012004b000015cd0000c13d00000011020000290000000f0020006b00000fdd0000813d000000400100043d0000002402100039000000110300002900000000003204350000099802000041000000000021043500000004021000390000000f0300002900000f030000013d000000840020008c00001a860000413d0000000401800370000000000101043b000009070010009c00001a860000213d000d00040010003d0000000d0220006a000009850020009c00001a860000213d000000e00020008c00001a860000413d0000006402800370000000000202043b000c00000002001d000008fe0020009c00001a860000213d000000800000043f000000a00000043f000000e00000043f000001000000043f000000e002000039000000c00020043f0000016002000039000000400020043f0000006401100039000000000118034f0000000d02800360000001200000043f000001400000043f000000000101043b001300000001001d000000000102043b000008fa0010009c00001a860000213d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b00000eed0000c13d000009a101000041000000000010043f0000001201000039000000040010043f0000090601000041000023e5000104300000000001000416000000000001004b00001a860000c13d0000000101000039000000800010043f0000095c01000041000023e40001042e000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000201043b000008fe0020009c00001a860000213d0000002401800370000000000301043b000000000100041123e31e5c0000040f0000000101000039000009d50000013d000000440020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000101043b000008fa0010009c00001a860000213d0000002402800370000000000202043b23e31d0b0000040f000000000001004b0000000001000039000000010100c039000000400200043d0000000000120435000008fa0020009c000008fa0200804100000040012002100000095f011001c7000023e40001042e000000240020008c00001a860000413d0000000001000416000000000001004b00001a860000c13d0000000401800370000000000601043b000008fe0060009c00001a860000213d000000000100041a000008fe051001970000000002000411000000000025004b000009f10000c13d000000000006004b00000c780000c13d0000091c01000041000000800010043f000000840000043f0000095e01000041000023e5000104300000095d01000041000000800010043f000000840020043f0000095e01000041000023e500010430001200000004001d001100000003001d001000000001001d001300000002001d00000002012002700000097901100197000f00000001001d000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000013020000290000000602200210000e00c000200193000000000101043b000000000101041a0000000e01100250000008fa01100197000000000010043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000001202000029000008fe02200197000000000101043b000000000101041a000008fe01100197000000000012004b00000ca80000c13d0000001101000029001108fe0010019b000000110020006b001200000002001d00000ddc0000c13d000000000020043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b001100000001001d000000000101041a000009690010019800000a4f0000c13d00000903010000410000000000100443000000120100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000001103000029000000000203041a0000096b02200197000000000112019f000000000013041b0000001001000029000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000d00000001001d000000000101041a000009690010019800000a770000c13d00000903010000410000000000100443000000100100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000000d03000029000000000203041a0000096b02200197000000000112019f000000000013041b0000090d01000041000000000101041a000c00000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d0000000c020000290000004002200270000008fd02200198000000000101043b000c00000001001d00000000012100a900000a920000613d00000000022100d90000000c0020006c000015cd0000c13d000008fd021001970000001101000029000000000101041a000000a0031002700000000002230049000008fd0020009c000015cd0000213d000008fe01100197000000a002200210000000000112019f0000001102000029000000000012041b0000090d01000041000000000201041a00000040022002700000000c022000b9000000a0022002100000000d04000029000000000304041a0000000002320019000000000024041b0000006002300270000b08fa0020019c00000acc0000c13d000000000101041a000008fa02100197000008fa0020009c000015cd0000613d00000971011001970000000104200039000000000114019f0000090d02000041000000000012041b000000600140021000000972011001970000000d03000029000000000203041a0000097302200197000000000112019f000000000013041b000b00000004001d000000000040043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000009000220019700000010022001af000000000021041b0000097a01000041000000200010043f0000000f01000029000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a0000000e032002500000000b0330014f000008fa033001970000000e033001f0000000000223013f000000000021041b0000001301000029000000000010043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a0000090002200197000000000021041b0000001201000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000001105000029000000000205041a00000978032001970000008002200270000009c80220009a000b00000002001d000008fa022001970000008004200210000000000334019f000000000101043b000000000035041b0000000302200270000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a001100000001001d0000001201000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000a00000001001d0000000f01000029000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a0000000a02000029000000200020043f0000000e02000029000a0020002001c30000000a01100250000e00000001001d0000000301100270000009c901100197000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000b020000290000000502200210000000e00220018f00110011002002570000000e020000290000000502200210000000e00220018f000000000101043b000000000301041a000000000423022f000000110440014f000008fa0440019700000000022401cf000000000232013f000000000021041b0000000d03000029000000000203041a000009ca0120009a0000097701100197000e00000002001d0000097802200197000000000121019f000000000013041b0000000f01000029000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000d00000001001d0000097a01000041000000200010043f00000011010000290000000101100210000009cb01100197001100000001001d0000000301100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000d030000290000000a0230025000000011030000290000000503300210000000c00330018f00000020033001bf000000000101043b000000000401041a000000000534022f000000000225013f000008fa0220019700000000023201cf000000000242013f000000000021041b0000001001000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000200010043f0000000e010000290000008301100270000009c901100197000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000e020000290000008002200270001100000002001d0000000502200210000000e00220018f000000000101043b000000000301041a000000000423022f000000130440014f000008fa0440019700000000022401cf000000000232013f000000000021041b0000097a01000041000000200010043f0000000f01000029000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a0000000a03200250000000110330014f000008fa033001970000000a033001f0000000000223013f000000000021041b0000090d01000041000000000101041a0000004001100270000008fd021001980000000c012000b900000bd60000613d00000000022100d90000000c0020006c000015cd0000c13d000000400200043d0000000000120435000008fa0020009c000008fa0200804100000040012002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d0200003900000003030000390000097e040000410000001205000029000000100600002923e323d90000040f0000000100200190000002360000c13d00001a860000013d000000000001004b00000bf40000c13d0000006002000039000000000103001900000c6c0000013d0000095d02000041000000800020043f000000840010043f0000095e01000041000023e5000104300000012002000039000000400020043f0000010003000039000001000000043f0000000402800370000000000202043b0000000007030019000000090020008c0000000a3220011a000000f808300210000000010370008a00000000090304330000098109900197000000000889019f00000982088001c7000000000083043500000bfa0000213d0000010102700089000000210770008a0000000000270435000000400200043d0000002008200039000000000006004b00000c4b0000613d000000000050043f000009830400004100000000050000190000000006850019000000000904041a000000000096043500000001044000390000002005500039000000000015004b00000c0f0000413d00000c4d0000013d0000001301000029000000000010043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000008fe01100197000000000010043f0000095f01000041000023e40001042e001000000002001d000000000010043f000009c401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001002000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000000ff001001900000043e0000c13d000000400100043d000009c502000041000003b60000013d000009d004400197000000000048043500000000011800190000000004070433000000000004004b00000c590000613d000000000500001900000000061500190000000007350019000000000707043300000000007604350000002005500039000000000045004b00000c520000413d00000000011400190000098403000041000000000031043500000000012100490000001b0310008a00000000003204350000002401100039000009cf011001970000000004210019000000000014004b000000000100003900000001010040390000000003040019000009070040009c00000f7f0000213d000000010010019000000f7f0000c13d0000000001030019000000400010043f001300000001001d23e31c4d0000040f00000013020000290000000001210049000008fa0010009c000008fa010080410000006001100210000008fa0020009c000008fa020080410000004002200210000000000121019f000023e40001042e0000090001100197000000000161019f000000000010041b0000000001000414000008fa0010009c000008fa01008041000000c00110021000000901011001c70000800d020000390000000303000039000009020400004123e323d90000040f0000000100200190000000a40000c13d00001a860000013d0000096e01100197000009d20000013d000008fa033001970000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000c910000c13d000000000005004b00000ca20000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000008fa0020009c000008fa020080410000004002200210000000000112019f000023e500010430000000400100043d000009c602000041000003b60000013d000000000200001900000cb10000013d000000100200002900000001022000390000000d0020006c00000fdb0000813d001000000002001d000000050120021000000012021000290000000201000367000000000221034f000000000202043b0000000e030000290000000003300079000001630330008a0000099a042001970000099a05300197000000000654013f000000000054004b00000000040000190000099a04004041000000000032004b00000000030000190000099a030080410000099a0060009c000000000403c019000000000004004b00001a860000c13d0000001204200029000000000241034f000000000202043b000008fa0020009c00001a860000213d000f00200040003d0000000f01100360000000000101043b001100000001001d000000000020043f0000000101000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c70000801002000039001300000004001d23e323de0000040f000000130b000029000000010020019000001a860000613d000000000101043b000000000101041a000000110010006c00000cad0000c13d0000000f01000029000000e0051000390000000202000367000000000152034f000000000601043b00000000010000310000000003b100490000001f0330008a0000099a043001970000099a07600197000000000847013f000000000047004b00000000070000190000099a07004041000000000036004b00000000090000190000099a090080410000099a0080009c000000000709c019000000000007004b00001a860000c13d0000000006b60019000000000762034f000000000a07043b0000090700a0009c00001a860000213d0000000007a10049000000200c6000390000099a067001970000099a08c00197000000000968013f000000000068004b00000000060000190000099a0600404100000000007c004b00000000070000190000099a070020410000099a0090009c000000000607c019000000000006004b00001a860000c13d000000200550008a000000000652034f000000000806043b000008fe0080009c00001a860000213d0000004009500039000000000592034f000000000505043b0000099a06500197000000000746013f000000000046004b00000000040000190000099a04004041000000000035004b00000000030000190000099a030080410000099a0070009c000000000403c019000000000004004b00001a860000c13d0000000003b50019000000000232034f000000000502043b000009070050009c00001a860000213d000000000151004900000020063000390000099a021001970000099a03600197000000000423013f000000000023004b00000000020000190000099a02004041000800000006001d000000000016004b00000000010000190000099a010020410000099a0040009c000000000201c019000000000002004b00001a860000c13d000900000009001d000a0000000c001d000b00000008001d000c0000000a001d001100000005001d00000903010000410000000000100443000000000100041000000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b000000110c0000290000000c0d00002900000013020000290000000b0e0000290000000a08000029000000090300002900001a860000613d000000400b00043d0000099b0100004100000000001b04350000000201000367000000000221034f000000800330008a000000000331034f000000000403043b000000000202043b000008fa0020009c00001a860000213d0000000403b0003900000000002304350000000f06000029000000000261034f000000000202043b0000002405b0003900000000002504350000002002600039000000000521034f000000000505043b000009070050009c00001a860000213d0000008406b00039000000e00700003900000000007604350000006406b0003900000000004604350000004404b000390000000000540435000000e404b000390000000000d40435000000000681034f000009cf07d001980000010404b00039000000000574001900000d7a0000613d000000000806034f0000000009040019000000008a08043c0000000009a90436000000000059004b00000d760000c13d0000001f08d0019000000d870000613d000000000676034f0000000307800210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000000005d400190000000000050435000000a405b000390000000000e504350000001f05d00039000009cf0550019700000000045400190000000003340049000000c405b00039000000000035043500000008051003600000000004c40436000009cf06c00198000000000364001900000d9c0000613d000000000705034f0000000008040019000000007907043c0000000008980436000000000038004b00000d980000c13d0000001f07c0019000000da90000613d000000000565034f0000000306700210000000000703043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f00000000005304350000000003c4001900000000000304350000008002200039000000000121034f000000000301043b00000000010004140000000002000410000000040020008c00000dd30000613d0000001f02c00039000009cf022001970000000002b200490000000002420019000008fa0020009c000008fa020080410000006002200210000008fa00b0009c00130000000b001d000008fa0400004100000000040b40190000004004400210000000000242019f000008fa0010009c000008fa01008041000000c001100210000000000121019f000000000003004b00000dca0000613d00000901011001c700008009020000390000000004000410000000000500001900000dcb0000013d000000000200041023e323d90000040f000300000001035500000000030100190000006003300270000108fa0030019d0000000100200190000000130b0000290000111e0000613d0000090700b0009c00000f7f0000213d0000004000b0043f00000cad0000013d0000095d01000041000000800010043f000000840060043f0000095e01000041000023e500010430000000000020043f000009c401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001102000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000000ff00100190000000120200002900000a280000c13d0000001301000029000000000010043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a000008fe01100197000000110010006b000000120200002900000a280000613d000000400100043d000009c702000041000003b60000013d000300000001035500000000020100190000006002200270000108fa0020019d000008fa02200197000009cf052001980000001f0620018f000000400300043d000000000453001900000e200000613d000000000701034f0000000008030019000000007907043c0000000008980436000000000048004b00000e1c0000c13d000000000006004b00000e2d0000613d000000000151034f0000000305600210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f0000000000140435000008fa0020009c000008fa020080410000006001200210000008fa0030009c000008fa030080410000004002300210000000000112019f000023e500010430000008fa00a0009c00130000000a001d000008fa0300004100000000030a40190000004003300210000008fa0010009c000008fa01008041000000c001100210000000000131019f00000910011001c723e323de0000040f00000000030100190000006003300270000108fa0030019d000008fa033001970003000000010355000000010020019000000ec30000613d000000130a000029000009cf053001980000001f0630018f00000000025a001900000e520000613d000000000701034f00000000080a0019000000007907043c0000000008980436000000000028004b00000e4e0000c13d000000000006004b00000e5f0000613d000000000151034f0000000305600210000000000602043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001204350000001f01300039000009cf0110019700000000050a00190000000002a10019000000000012004b00000000010000390000000101004039000009070020009c00000f7f0000213d000000010010019000000f7f0000c13d000000400020043f000009850030009c00001a860000213d000000200030008c00001a860000413d0000000001050433000009070010009c00001a860000213d0000000006050019000000000563001900000000016100190000001f03100039000000000053004b00000000060000190000099a060080410000099a033001970000099a07500197000000000873013f000000000073004b00000000030000190000099a030040410000099a0080009c000000000306c019000000000003004b00001a860000c13d0000000031010434000009070010009c00000f7f0000213d0000001f06100039000009cf066001970000003f06600039000009cf046001970000000004240019000009070040009c00000f7f0000213d000000400040043f00000000041204360000000006310019000000000056004b00001a860000213d000000000001004b00000e9c0000613d000000000500001900000000064500190000000007350019000000000707043300000000007604350000002005500039000000000015004b00000e950000413d000000000141001900000000000104350000099d01000041000000400300043d001300000003001d0000000000130435000000040130003923e31c4d0000040f00000013020000290000000001210049000008fa0010009c000008fa010080410000006001100210000008fa0020009c000008fa020080410000004002200210000000000121019f000023e500010430000f00110010007400000ecf0000813d000000400100043d000009af02000041000003b60000013d001300000001001d000008fe021001970000000601000039000000000301041a0000090003300197000000000323019f000000000031041b0000090d01000041000000000101041a0000090e0010019800000f850000c13d000000000002004b000010a80000c13d000000400100043d0000091b02000041000003b60000013d0000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000eca0000c13d00000c950000013d0000001301000029000000000010043f000009ae01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001002000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000000f02000029000000000021041b000006730000013d0000000d0200002900000040022000390000000202200367000000000302043b00000000021300d9000b0000001200ad000000000031004b00000ef80000213d0000000b022000f9000000000012004b000015cd0000c13d00000013020000290000000b0020006b0000105c0000813d000000400100043d0000002402100039000000130300002900000000003204350000099802000041000000000021043500000004021000390000000b030000290000000000320435000008fa0010009c000008fa01008041000000400110021000000999011001c7000023e500010430000000000001004b000000000300001900000f0f0000613d0000002003400039000000000338034f000000000303043b0000000304100210000009d10440027f000009d104400167000000000443016f000000010310021000000fd70000013d000000a004000039000000130500002900000f200000013d000000000779001900000000000704350000004007600039000000000087043500000000046404360000002005500039000000000035004b0000112b0000813d000000000c01034f00000000065c034f000000000606043b000009070060009c000000000d02001900001a860000213d000000130760002900000000067d0049000009850060009c00001a860000213d000000600060008c00001a860000413d000000400600043d000009870060009c00000f7f0000213d0000006008600039000000400080043f00000000087c034f000000000808043b000008fa0080009c00001a860000213d00000000098604360000002008700039000000000a8c034f000000000a0a043b0000ffff00a0008c00001a860000213d0000000000a90435000000200880003900000000088c034f000000000808043b000009070080009c00001a860000213d00000000097800190000001f079000390000000000d7004b00000000080000190000099a080080410000099a07700197000000000007004b000000000a0000190000099a0a0040410000099a0070009c000000000a08c01900000000000a004b00001a860000c13d00000000079c034f000000000707043b000009070070009c00000f7f0000213d0000001f08700039000009cf088001970000003f08800039000009cf0a800197000000400800043d000000000aa8001900000000008a004b000000000b000039000000010b0040390000090700a0009c00000f7f0000213d0000000100b0019000000f7f0000c13d000000200b9000390000004000a0043f0000000009780436000000000ab700190000000000da004b00001a860000213d000000000bbc034f000009cf0c700198000000000ac9001900000f6f0000613d000000000d0b034f000000000e09001900000000df0d043c000000000efe04360000000000ae004b00000f6b0000c13d0000001f0d70019000000f180000613d000000000bcb034f000000030cd00210000000000d0a0433000000000dcd01cf000000000dcd022f000000000b0b043b000001000cc00089000000000bcb022f000000000bcb01cf000000000bdb019f0000000000ba043500000f180000013d000009700010009c0000108c0000a13d000009a101000041000000000010043f0000004101000039000000040010043f0000090601000041000023e500010430000000400100043d0000090f02000041000003b60000013d00000080040000390000006005000039000000000700001900000f940000013d0000001f0a900039000009cf0aa001970000000009890019000000000009043500000000088a00190000000107700039000000000027004b000003300000813d0000000009180049000000400990008a00000000039304360000002004400039000000000904043300000000ba090434000008fa0aa00197000000000aa80436000000000b0b04330000ffff0bb0018f0000000000ba043500000040099000390000000009090433000000400a80003900000000005a0435000000600b80003900000000a909043400000000009b04350000008008800039000000000009004b00000f8c0000613d000000000b000019000000000c8b0019000000000dba0019000000000d0d04330000000000dc0435000000200bb0003900000000009b004b00000faa0000413d00000f8c0000013d000008fa033001970000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00000fba0000c13d00000c950000013d00000983040000410000000006000019000000000908034f0000000007360019000000000779034f000000000707043b000000000074041b00000001044000390000002006600039000000000056004b00000fc20000413d000000000015004b00000fd50000813d0000000305100210000000f80550018f000009d10550027f000009d1055001670000000003360019000000000338034f000000000303043b000000000353016f000000000034041b00000001030000390000000104100210000000000134019f000000000012041b0000000001000019000023e40001042e000000400a00043d0000015c0000013d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000601043b000000000006004b000009aa0000613d0000000e0100002900000060051000390000000202000367000000000152034f000000000701043b0000000001000031000000130310006a0000001f0330008a0000099a043001970000099a08700197000000000948013f000000000048004b00000000080000190000099a08004041000000000037004b000000000a0000190000099a0a0080410000099a0090009c00000000080ac019000000000008004b00001a860000c13d0000001308700029000000000782034f000000000707043b000009070070009c00001a860000213d0000000009710049000000200a8000390000099a089001970000099a0ba00197000000000c8b013f00000000008b004b00000000080000190000099a0800404100000000009a004b00000000090000190000099a090020410000099a00c0009c000000000809c019000000000008004b00001a860000c13d0000001f08700039000009cf088001970000003f08800039000009cf08800197000000400900043d0000000008890019000000000098004b000000000b000039000000010b004039000009070080009c00000f7f0000213d0000000100b0019000000f7f0000c13d000000400080043f0000000008790436000000000ba7001900000000001b004b00001a860000213d0011000000a20353000009cf0c7001980000001f0d70018f000000000ac80019000010350000613d000000110e00035f000000000f08001900000000eb0e043c000000000fbf04360000000000af004b000010310000c13d0000000f066000f900000000000d004b000010430000613d000000110bc0035f000000030cd00210000000000d0a0433000000000dcd01cf000000000dcd022f000000000b0b043b000001000cc00089000000000bcb022f000000000bcb01cf000000000bdb019f0000000000ba043500000000077800190000000000070435000000800550008a000000000552034f000000000505043b0000000007090433000000c006600210000000400b00043d000000400ab0003900000000006a0435000e0000000b001d0000002006b00039000f00000006001d0000000000560435000000000007004b000014780000c13d00000028050000390000000e060000290000000000560435000009870060009c00000f7f0000213d001100010000003d0000000e050000290000006005500039000014980000013d0000000001000411000008fe01100197001300000001001d000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000a00000001001d000000000101041a0000096900100198000010860000c13d00000903010000410000000000100443000000000100041100000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000000a03000029000000000203041a0000096b02200197000000000112019f000000000013041b000000a0021002700012000b00200074000011eb0000813d000000400100043d0000099702000041000003b60000013d0000004003100039000000400030043f00000000032104360000000000230435000001000400043d000000400200043d00000000044204360000004005200039000001200600043d000000a00700003900000000007504350000000000640435000000a005200039000001400400043d0000000000450435000000c00520003900000005064002100000000009560019000000000004004b000010b70000c13d000000000101043300000060042000390000000000140435000000000103043300000080032000390000000000130435000000000129004900000c700000013d0000091101000041000000000010043f0000000001000411000000200010043f0000000001000414000000040020008c000010db0000c13d0000001c0100043d000000000010043f0000000002000019000011000000013d0000096201000041000000800010043f0000096301000041000023e50001043000000140060000390000000008000019000000400f000039000010c30000013d0000001f0ba00039000009cf0bb00197000000000a9a001900000000000a043500000000099b00190000000108800039000000000048004b000010a00000813d000000000a290049000000c00aa0008a0000000005a504360000002006600039000000000a06043300000000ba0a0434000000000aa90436000000000b0b04330000000000fa0435000000400c90003900000000ba0b04340000000000ac0435000000600990003900000000000a004b000010bb0000613d000000000c000019000000000d9c0019000000000ecb0019000000000e0e04330000000000ed0435000000200cc000390000000000ac004b000010d30000413d000010bb0000013d000008fa0010009c000008fa01008041000000c00110021000000912011001c723e323d90000040f00000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0540018f0000002004400190000010ef0000613d000000000601034f0000000007000019000000006806043c0000000007870436000000000047004b000010eb0000c13d000000000005004b000010fc0000613d000000000641034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000100000003001f0003000000010355000000010220015f000000000100043d0000000100200190000011130000c13d000000010010008c000011130000c13d0000001101000029000008fd00100198000000130100002900000060011002100000091303000041000000000203041a000008fd02200197000000000412019f0000090d01000041000000000201041a000000000043041b000011d40000c13d000000400100043d0000091802000041000003b60000013d0000091901000041000000000010043f0000091a01000041000023e500010430000000400100043d000009b20200004100000000002104350000000402100039000000000300041100000000003204350000009d0000013d000008fa033001970000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000011260000c13d00000c950000013d000000800100043d000000000001004b000003260000613d0000000002000019000011380000013d000000010180021000000001011001bf000000000017041b00000013020000290000000102200039000000800100043d000000000012004b000003260000813d001300000002001d0000000501200210000000a001100039001100000001001d000000000101043300000040021000390000000002020433001200000002001d000000020220003900000000020204330000ffff0220018f000000030020008c0000145b0000c13d0000000001010433000008fa01100197000000000010043f0000000301000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000800200043d000000130020006c0000146f0000a13d000000000101043b00000011020000290000000002020433000000200220003900000000020204330000ffff0220018f000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000701043b00000012010000290000000034010434000009070040009c00000f7f0000213d000000000107041a000000010010019000000001051002700000007f0550618f0000001f0050008c00000000020000390000000102002039000000000121013f00000001001001900000063b0000c13d000000200050008c001100000007001d001000000004001d000011990000413d000e00000005001d000f00000003001d000000000070043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000010040000290000001f024000390000000502200270000000200040008c0000000002004019000000000301043b0000000e010000290000001f01100039000000050110027000000000011300190000000002230019000000000012004b00000011070000290000000f03000029000011990000813d000000000002041b0000000102200039000000000012004b000011950000413d000000200040008c000011ba0000413d000000000070043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000001008000029000009cf02800198000000000101043b000011c60000613d000000010320008a00000005033002700000000003310019000000010430003900000020030000390000001206000029000000110700002900000000056300190000000005050433000000000051041b00000020033000390000000101100039000000000041004b000011b00000c13d000000000082004b000011300000813d000011cb0000013d000000000004004b000011c40000613d0000000301400210000009d10110027f000009d1011001670000000002030433000000000112016f0000000102400210000000000121019f000011320000013d0000000001000019000011320000013d000000200300003900000012060000290000001107000029000000000082004b000011300000813d0000000302800210000000f80220018f000009d10220027f000009d10220016700000000036300190000000003030433000000000223016f000000000021041b000011300000013d0000091402200197000000110300002900000040033002100000091503300197000000000223019f00000916022001c7000000000021041b000000800100043d00000140000004430000016000100443000000a00100043d00000020030000390000018000300443000001a0001004430000004001000039000000c00200043d000001c000100443000001e0002004430000010000300443000000030100003900000120001004430000091701000041000023e40001042e000008fe011001970000001202000029000000a002200210000000000112019f0000091302000041000000000302041a0000000a04000029000000000014041b0000000b0130006a000008fd01100197000000000302041a0000096d03300197000000000113019f000000000012041b0000001301000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000090d02000041000000000202041a001300000002001d000000000101043b001100000001001d0000000a01000029000000000101041a001000000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b00000013020000290000004002200270000008fd0220019700000000012100aa000009aa0000613d00000010020000290000008002200270000008fa0220019700000012011000f90000000005020019000000000112004b0000000001004019000015380000a13d000000a002100210000000130220006900000975022001970000090d03000041000000000403041a0000097604400197000000000224019f000000000023041b000000400200043d000900000002001d000009700020009c00000f7f0000213d00000009060000290000004002600039000000400020043f000000600200003900000000072604360000000000070435000000400200043d00000040032000390000000000130435000000600220003900000005041002100000000004420019000000400040043f00000000003604350010000000150051000f00000007001d00000000002704350000000001000411000e006000100218000000010550008a001300000005001d0000000301500270000000000010043f0000001101000029000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000101041a0000097a02000041000000200020043f00000013020000290000000502200210000000e00220018f000000000121022f000008fa01100197001200000001001d0000000201100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000012050000290000000602500210000000c00220018f000000000101043b000000000301041a000000000423022f000009070440019700000000022401cf000000000232013f000000000021041b000000000050043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a0000090002200197000000000021041b000000120100002900000008011002100000000e011001af00000001011001bf0000000f030000290000000002030433000000000112043600000000001304350000001305000029000000100050006c000012490000c13d0000001001000029000000800110021000000977011001970000000a03000029000000000203041a0000097802200197000000000112019f000000000013041b0000091301000041000000000201041a00000009010000290000000001010433000000200310008a00000020040000390000000000430435000000400410008a0000097c03000041001300000004001d0000000000340435000000240310008a000000000401043300000000010004140000006002200270000000040020008c000015050000c13d0000000001030433000000130200002900000000001204350000000102000039000015340000013d00000002010003670000002403100370000000000303043b000000000032004b000014530000c13d0000001102000029000000200020008c00001a860000413d00000010020000290000002002200039000000000321034f000000000303043b001000000003001d0000001103000029000000280030008c00001a860000413d0000002002200039000000000121034f000000000101043b000e00000001001d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d0000000e04000029000000c002400270000000000101043b00040000002100ad000009660040009c000012dc0000413d00000004022000f9000000000012004b000015cd0000c13d00000004010000390000000201100367000000000101043b000008fa0010009c00001a860000213d0000001001000029000208fe0010019c00000002010000290000dead01006039000300000001001d000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b001000000001001d000000000101041a00000969001001980000130d0000c13d00000903010000410000000000100443000000030100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000001003000029000000000203041a0000096b02200197000000000112019f000000000013041b00000004010000290000096c0010009c000014750000213d0000091301000041000000000101041a000008fd021001970000000402200029000e00000002001d000009b40020009c000014750000813d0000096d011001970000000e011001af0000091302000041000000000012041b0000001003000029000000000403041a000000a0014002700000000401100029000c00000001001d000000a001100210000008fe02400197000000000121019f000000000013041b000d00000004001d0000096e004001980000136d0000c13d0000000301000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000090d02000041000000000202041a000b00000002001d000000000101043b000900000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b0000000b020000290000004002200270000008fd0220019700050000002100ae000009aa0000613d000000400100043d000100000001001d000009700010009c00000f7f0000213d0000000d010000290000008001100270000008fa011001970000000c0300002900000005023000fa000b00000001001d000800000002001d000000000112004b000000000100401900000001040000290000004002400039000000400020043f000000600200003900000000052404360000000000050435000000400200043d00000040032000390000000000130435000000050110021000000060022000390000000001120019000000400010043f000700000005001d000000000025043500000000003404350000000001030433000000000001004b000017bf0000c13d000000400100043d00000004020000290000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d0200003900000003030000390000097e040000410000000005000019000000030600002923e323d90000040f000000010020019000001a860000613d0000001101000029000000280510008c000014370000a13d00000002060003670000004401600370000000000101043b000009070010009c00001a860000213d0000000402600370000000000202043b000008fa0020009c00001a860000213d000009070050009c00000f7f0000213d0000001103000029000000090330008a000009cf033001970000003f03300039000009cf03300197000000400400043d0000000003340019000000000043004b00000000070000390000000107004039000009070030009c00000f7f0000213d000000010070019000000f7f0000c13d000000400030043f00000000035404360000000f08000029000000000080007c00001a860000213d00000013070000290000004c07700039000000000676034f000009cf075001980000001f0850018f0000000005730019000013af0000613d000000000906034f000000000a030019000000009b09043c000000000aba043600000000005a004b000013ab0000c13d000000000008004b000013bc0000613d000000000676034f0000000307800210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000001105400029000000080550008a0000000000050435000000c001100210000000400600043d0000002005600039001300000005001d0000000000150435000000e001200210000000280260003900000000001204350000002c0160003900000004020000290000000000210435001100000006001d0000004c026000390000000001040433000000000001004b000013d70000613d000000000400001900000000052400190000000006340019000000000606043300000000006504350000002004400039000000000014004b000013d00000413d000000000221001900000000000204350000002c02100039000000110300002900000000002304350000006b01100039000009cf021001970000000001320019000000000021004b00000000020000390000000102004039000009070010009c00000f7f0000213d000000010020019000000f7f0000c13d000000400010043f00000903010000410000000000100443000000000100041100000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b00001a860000613d000000400300043d0000006401300039000000800200003900000000002104350000002401300039000000120200002900000000002104350000097f010000410000000000130435000000040130003900000002020000290000000000210435000000440130003900000000000104350000001101000029000000000101043300000084023000390000000000120435001100000003001d000000a402300039000000000001004b000014150000613d000000000300001900000000042300190000001305300029000000000505043300000000005404350000002003300039000000000013004b0000140e0000413d0000000002210019000000000002043500000000020004140000000003000411000000040030008c000014320000613d0000001f01100039000009cf01100197000000a401100039000008fa0010009c000008fa0100804100000060011002100000001103000029000008fa0030009c000008fa030080410000004003300210000000000131019f000008fa0020009c000008fa02008041000000c002200210000000000112019f000000000200041123e323d90000040f00000000030100190000006003300270000108fa0030019d0003000000010355000000010020019000001c220000613d0000001101000029000009070010009c00000f7f0000213d0000001101000029000000400010043f00000004010000390000000201100367000000000101043b000008fa0010009c00001a860000213d000000400200043d0000002003200039000000040400002900000000004304350000000000120435000008fa0020009c000008fa0200804100000040012002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f00000968011001c70000800d02000039000000030300003900000980040000410000001205000029000000020600002923e323d90000040f0000000100200190000000a40000c13d00001a860000013d000000400100043d00000024021000390000000000320435000009b302000041000000000021043500000004021000390000000e0300002900000f030000013d000000400300043d001300000003001d000009a00100004100000000001304350000000401300039000000200200003900000000002104350000002402300039000000120100002923e31c3b0000040f00000013020000290000000001210049000008fa0010009c000008fa01008041000008fa0020009c000008fa0200804100000060011002100000004002200210000000000121019f000023e500010430000009a101000041000000000010043f0000003201000039000000040010043f0000090601000041000023e500010430000000400100043d000009b502000041000003b60000013d0000000e0700002900000048057000390000000006000411000000000065043500000068067000390000000005090433000000000005004b000014880000613d00000000070000190000000009670019000000000a870019000000000a0a04330000000000a904350000002007700039000000000057004b000014810000413d0000000006650019000000000006043500000048065000390000000e0700002900000000006704350000008705500039000009cf065001970000000005760019000000000065004b00000000060000390000000106004039000009070050009c00000f7f0000213d000000010060019000000f7f0000c13d001100020000003d000000400050043f0000001305200360000000000505043b000008fa0050009c00001a860000213d00000013060000290000008006600039000000000662034f000000000606043b0000099a07600197000000000847013f000000000047004b00000000040000190000099a04004041000000000036004b00000000030000190000099a030080410000099a0080009c000000000403c019000000000004004b00001a860000c13d0000001303600029000000000232034f000000000202043b000d00000002001d000009070020009c00001a860000213d0000000d0110006a00000020063000390000099a021001970000099a03600197000000000423013f000000000023004b00000000020000190000099a02004041000c00000006001d000000000016004b00000000010000190000099a010020410000099a0040009c000000000201c019000000000002004b00001a860000c13d000000000050043f0000000301000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b0000001102000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000000010320019000000001042002700000007f0440618f001100000004001d0000001f0040008c00000000040000390000000104002039000000000043004b0000063b0000c13d000000400400043d000b00000004001d00000011050000290000000004540436001300000004001d000000000003004b000017390000613d000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000110000006b00000000020000190000173f0000613d000000000101043b00000000020000190000001303200029000000000401041a000000000043043500000001011000390000002002200039000000110020006c000014fd0000413d0000173f0000013d000008fa0030009c000008fa03008041000000400330021000000005044002100000004404400039000008fa0040009c000008fa040080410000006004400210000000000334019f000008fa0010009c000008fa01008041000000c001100210000000000113019f23e323d90000040f00000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0540018f00000020064001900000001304600029000015230000613d000000000701034f0000001308000029000000007907043c0000000008980436000000000048004b0000151f0000c13d000000000005004b000015300000613d000000000661034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000100000003001f000300000001035500000013010000290000000001010433000000010020019000001a860000613d000000010010008c00001a860000c13d000000400100043d0000000b020000290000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d0200003900000003030000390000097e040000410000000005000411000000000600001923e323d90000040f000000010020019000001a860000613d0000000d010000290000000b0200002923e321090000040f000000000400003100000002030003670000000d05300360001200000001001d001100000002001d000000000105043b001300000001001d000008fa0010009c00001a860000213d000009850040009c00001a860000213d000000640040008c00001a860000413d000000400100043d000009700010009c00000f7f0000213d0000004002100039000000400020043f0000002402300370000000000202043b00000000042104360000004402300370000000000202043b001000000004001d0000000000240435000000400200043d000009870020009c00000f7f0000213d0000006003200039000000400030043f000000200320003900000000000304350000000000020435000000400300043d000009700030009c00000f7f0000213d0000004004300039000000400040043f0000002004300039000000000004043500000000000304350000004002200039000000000032043500000000010104330000000002000416000000000012004b0000159f0000c13d00000010010000290000000001010433000f00000001001d000000000001004b000015a50000c13d0000001301000029000000000010043f0000000101000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000400300043d000000000101043b000000000401041a000000000004004b000015d30000c13d00000996010000410000000000130435000000040130003900000013020000290000000000210435000008fa0030009c000008fa03008041000000400130021000000906011001c7000023e500010430000000400100043d00000988020000410000000000210435000000040210003900000000030004160000111c0000013d0000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000201043b000000400300043d0000098901000041000e00000003001d00000000001304350000000001000414000008fe02200197000a00000002001d000000040020008c000016470000c13d0000000103000031000000200030008c00000020040000390000000004034019000016730000013d0000001002000029000000000202041a0000006002200270000708fa0020019c000016a90000c13d0000090d01000041000000000201041a000008fa03200197000008fa0030009c000016890000c13d000009a101000041000000000010043f0000001101000039000000040010043f0000090601000041000023e5000104300000098b0030009c00000f7f0000213d00000010010000290000000001010433000000a002300039000000400020043f000000000001004b0000000002000039000000010200c0390000008001300039000000000021043500000060023000390000001105000029000000000052043500000040053000390000001206000029000000000065043500000020063000390000000000460435000000130400002900000000004304350000099204000041000000400800043d0000000004480436001000000004001d0000000404800039000000400700003900000000007404350000000003030433000008fa033001970000004404800039000000000034043500000000030604330000006404800039000000000034043500000000030504330000008404800039000000a0050000390000000000540435000000e40680003900000000540304340000000000460435001300000008001d0000010403800039000000000004004b000016090000613d000000000600001900000000073600190000000008650019000000000808043300000000008704350000002006600039000000000046004b000016020000413d000000000534001900000000000504350000001f04400039000009cf0440019700000000020204330000001305000029000000a405500039000000c0064000390000000000650435000000000334001900000000260204340000000007630436000000000006004b0000161f0000613d000000000300001900000000047300190000000005320019000000000505043300000000005404350000002003300039000000000063004b000016180000413d001200000006001d001100000007001d0000000002760019000000000002043500000000010104330000000c02000029000008fe02200197000000130400002900000024034000390000000000230435000000000001004b0000000001000039000000010100c039000000c40240003900000000001204350000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000201043b0000000001000414000008fe04200197000000040040008c000017a80000c13d0000000103000031000000800030008c00000080040000390000000004034019000019890000013d0000000e02000029000008fa0020009c000008fa020080410000004002200210000008fa0010009c000008fa01008041000000c001100210000000000121019f00000910011001c70000000a0200002923e323de0000040f00000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0640018f00000020074001900000000e05700029000016620000613d000000000801034f0000000e09000029000000008a08043c0000000009a90436000000000059004b0000165e0000c13d000000000006004b0000166f0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f000300000001035500000001002001900000177e0000613d0000001f01400039000000600210018f0000000e01200029000000000021004b00000000020000390000000102004039000009070010009c00000f7f0000213d000000010020019000000f7f0000c13d000000400010043f000000200030008c00001a860000413d0000000e020000290000000002020433000e00000002001d000008fe0020009c00001a860000213d0000000e0000006b0000187a0000c13d0000099102000041000003b60000013d00000971022001970000000104300039000000000224019f000000000021041b000000600140021000000972011001970000001003000029000000000203041a0000097302200197000000000112019f000000000013041b000700000004001d000000000040043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000009000220019700000004022001af000000000021041b0000000201000029000000000101043300000000010104330000000b03000029000e000f00300101000000a0011002100000090d02000041000000000302041a000000000113001900000975011001970000097604300197000000000141019f000000000012041b0000000901000029000000800110021000000977011001970000001004000029000000000204041a0000097802200197000000000112019f000000000014041b000000040100002900060060001002180000002001300270000008fa03100197000016c30000013d00000001033000390000000e0030006c0000000103002039001000000003001d0000000201300270000f00000001001d0000097901100197000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000010030000290000000602300210000000c00220018f000000000101043b000000000101041a000000000121022f000008fa00100198000016c00000c13d000b00000002001d0000000a01000029000000200010043f0000000c010000290000000301100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000c020000290000000502200210000000e00220018f000000000101043b000000000301041a000000000423022f000000100440014f000008fa0440019700000000022401cf000000000232013f000000000021041b0000097a01000041000000200010043f0000000f01000029000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000c05000029000000200250021000000007022001af000000000101043b000000000301041a0000000b04300250000000000224013f00000907022001970000000b022001f0000000000232013f000000000021041b0000001004000029000000080140021000000006011001af000000080300002900000000020304330000000001120436000000000013043500000001044000390000000e0040006c000000010400203900000000030400190000000105500039000c00000005001d000000090050006c000016c30000c13d00000020013002100000090e011001970000090d02000041000000000302041a0000097b03300197000000000113019f000000000012041b0000091301000041000000000201041a00000002010000290000000001010433000000200310008a00000020040000390000000000430435000000400410008a0000097c03000041001000000004001d0000000000340435000000240310008a000000000401043300000000010004140000006002200270000000040020008c00001a530000c13d000000000103043300000010020000290000000000120435000000010200003900001a820000013d000009d00120019700000013020000290000000000120435000000110000006b000000200200003900000000020060390000003f01200039000009cf011001970000000b02100029000000000012004b00000000010000390000000101004039001100000002001d000009070020009c00000f7f0000213d000000010010019000000f7f0000c13d0000001101000029000000400010043f0000000b010000290000000001010433000000000001004b0000178a0000c13d0000000d010000290000001f01100039000009cf011001970000003f01100039000009cf011001970000001101100029000009070010009c00000f7f0000213d000000400010043f00000011010000290000000d0300002900000000013104360000000c03300029000000000030007c00001a860000213d0000000d04000029000009cf034001980000001f0440018f0000000c02000029000000020520036700000000023100190000176c0000613d000000000605034f0000000007010019000000006806043c0000000007870436000000000027004b000017680000c13d000000000004004b000017790000613d000000000335034f0000000304400210000000000502043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f00000000003204350000000d011000290000000000010435000000400100043d001300000001001d000018980000013d0000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000017850000c13d00000c950000013d0000000d0000006b000018960000613d0000000d01000029000000010010008c000018bb0000c13d0000001104000029000000240140003900000001020000390000000000210435000009a00100004100000000001404350000000401400039000000200200003900000000002104350000004401400039000000000201043300000981022001970000000c030000290000000203300367000000000303043b000009a703300197000000000223019f000000000021043500000045014000390000000000010435000008fa0040009c000008fa040080410000004001400210000009a8011001c7000023e5000104300000001305000029000000110250006900000012030000290000001f03300039000009cf033001970000000002320019000008fa0050009c000008fa0300004100000000030540190000004003300210000008fa0020009c000008fa020080410000006002200210000000000232019f000008fa0010009c000008fa01008041000000c001100210000000000121019f0000000002000416000000000002004b000019630000c13d0000000002040019000019670000013d0000001002000029000000000202041a0000006002200270000608fa0020019c000017e90000c13d0000090d01000041000000000201041a000008fa03200197000008fa0030009c000015cd0000613d00000971022001970000000104300039000000000224019f000000000021041b000000600140021000000972011001970000001003000029000000000203041a0000097302200197000000000112019f000000000013041b000600000004001d000000000040043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000000101043b000000000201041a000009000220019700000003022001af000000000021041b0000000101000029000000000101043300000000010104330000000503000029000c000e00300101000000a0011002100000090d02000041000000000302041a000000000113001900000975011001970000097604300197000000000141019f000000000012041b0000000801000029000000800110021000000977011001970000001004000029000000000204041a0000097802200197000000000112019f000000000014041b000000030100002900050060001002180000002001300270001008fa0010019b000018050000013d000000100200002900000001022000390000000c0020006c0000000102002039001000000002001d00000010010000290000000201100270000e00000001001d0000097901100197000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d00000010020000290000000602200210000d00c000200193000000000101043b000000000101041a0000000d01100250000008fa00100198000018000000c13d0000000901000029000000200010043f0000000b010000290000000301100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000b020000290000000502200210000000e00220018f000000000101043b000000000301041a000000000423022f000000100440014f000008fa0440019700000000022401cf000000000232013f000000000021041b0000097a01000041000000200010043f0000000e01000029000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d0000000b05000029000000200250021000000006022001af000000000101043b000000000301041a0000000d04300250000000000224013f00000907022001970000000d022001f0000000000232013f000000000021041b0000001004000029000000080140021000000005011001af000000070300002900000000020304330000000001120436000000000013043500000001044000390000000c0040006c0000000104002039001000000004001d0000000105500039000b00000005001d000000080050006c000018050000c13d000000100100002900000020011002100000090e011001970000090d02000041000000000302041a0000097b03300197000000000113019f000000000012041b0000091301000041000000000201041a00000001010000290000000001010433000000200310008a00000020040000390000000000430435000000400410008a0000097c03000041001000000004001d0000000000340435000000240310008a000000000401043300000000010004140000006002200270000000040020008c00001bec0000c13d00000000010304330000001002000029000000000012043500001c1c0000013d00000064021000390000000f04000029000000000042043500000044021000390000000a04000029000000000042043500000020021000390000098a040000410000000000420435000000240410003900000000050004110000000000540435000000640400003900000000004104350000098b0010009c00000f7f0000213d000000a004100039000f00000004001d000000400040043f000000000401043300000000010004140000000e05000029000000040050008c00001a880000c13d000009070030009c00000f7f0000213d000000010200003900001ab90000013d001300110000002d0011000b0000002d0000000401000039000000000101041a000008fe021001980000192e0000c13d0000001301000029000009700010009c00000f7f0000213d0000004002100039000000400020043f0000002002100039000000000002043500000000000104350000001001000029000000000010043f0000000101000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001a860000613d000000400300043d000000000101043b000000000401041a000000000004004b00001b0a0000c13d0000099601000041000000000013043500000004013000390000001002000029000015990000013d0000000d010000290000001f01100039000009cf011001970000003f01100039000009cf011001970000001101100029000009070010009c00000f7f0000213d000000400010043f00000011010000290000000d0400002900000000024104360000000c01400029000000000010007c00001a860000213d00000002010003670000000c041003600000000d06000029000009cf056001980000001f0660018f0000000003520019000018d70000613d000000000704034f0000000008020019000000007907043c0000000008980436000000000038004b000018d30000c13d000000000006004b000018e40000613d000000000454034f0000000305600210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000d022000290000000000020435000000400a00043d0000001102000029000000020220003900000000020204330000ffff0220018f000000030020008c00001aff0000c13d0000002005a000390000000d02000029000000020220008a0000000b030000290000000003030433000000000003004b000018fc0000613d000000000400001900000000065400190000001307400029000000000707043300000000007604350000002004400039000000000034004b000018f50000413d0000000c040000290000000204400039000000000441034f000000000153001900000000000104350000000001a30019000009cf052001980000001f0620018f000000200710003900000000035700190000190c0000613d000000000804034f000000008908043c0000000007970436000000000037004b000019080000c13d000000000006004b000019190000613d000000000454034f0000000305600210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f000000000043043500000000012100190000002002100039000000000002043500000000030a0019000000000131004900000000001304350000003f01100039000009cf011001970000000002310019000000000012004b00000000010000390000000101004039001300000002001d000009070020009c00000f7f0000213d000000010010019000000f7f0000c13d0000001301000029000000400010043f00110000000a001d000018980000013d000009a901000041000000130500002900000000001504350000000401500039000000400300003900000000003104350000000e030000290000000003030433000000440450003900000000003404350000006404500039000000000003004b000019430000613d000000000500001900000000064500190000000f07500029000000000707043300000000007604350000002005500039000000000035004b0000193c0000413d000000000543001900000000000504350000001f03300039000009cf0330019700000000054300190000000001150049000000130300002900000024033000390000000000130435000000110100002900000000430104340000000001350436000000000003004b000019590000613d000000000500001900000000061500190000000007540019000000000707043300000000007604350000002005500039000000000035004b000019520000413d000000000413001900000000000404350000000004000414000000040020008c00001a0a0000c13d0000000103000031000000200030008c0000002004000039000000000403401900001a3e0000013d00000901011001c700008009020000390000000003000416000000000500001923e323d90000040f00000000030100190000006003300270000008fa03300197000000800030008c000000800400003900000000040340190000001f0640018f000000e0074001900000001305700029000019780000613d000000000801034f0000001309000029000000008a08043c0000000009a90436000000000059004b000019740000c13d000000000006004b000019850000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00030000000103550000000100200190000019fe0000613d0000001f01400039000001e00110018f0000001302100029000000000012004b00000000010000390000000101004039001200000002001d000009070020009c00000f7f0000213d000000010010019000000f7f0000c13d0000001201000029000000400010043f000000800030008c00001a860000413d0000001201000029000009870010009c00000f7f0000213d00000012020000290000006001200039000000400010043f000000130100002900000000010104330000000001120436001100000001001d00000010010000290000000001010433000009070010009c00001a860000213d00000011020000290000000000120435000000400100043d000009700010009c00000f7f0000213d0000004002100039000000400020043f000000130300002900000040023000390000000002020433000000000221043600000060033000390000000003030433000000000032043500000012020000290000004002200039001000000002001d0000000000120435000000400100043d001300000001001d000009700010009c00000f7f0000213d00000013020000290000004001200039000000400010043f0000000b010000290000000002120436000f00000002001d00000000001204350000000d010000290000000201100367000000000101043b000008fa0010009c00001a860000213d00000012020000290000000005020433000000400200043d00000040032000390000000b040000290000000000430435000000200320003900000000004304350000000000120435000008fa0020009c000008fa0200804100000040012002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f00000993011001c70000800d0200003900000003030000390000099404000041000000000600041123e323d90000040f000000010020019000001a860000613d00000012010000290000000001010433000000400200043d000000000112043600000011030000290000000003030433000009070330019700000000003104350000001001000029000000000101043300000000310104340000004004200039000000000014043500000000010304330000006003200039000000000013043500000013010000290000000001010433000000800320003900000000001304350000000f010000290000000001010433000000a0032000390000000000130435000008fa0020009c000008fa02008041000000400120021000000995011001c7000023e40001042e0000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00001a050000c13d00000c950000013d0000001f03300039000009cf033001970000001305000029001300000005001d00000000015100490000000001310019000008fa0010009c000008fa010080410000006001100210000008fa0050009c000008fa0300004100000000030540190000004003300210000000000131019f000008fa0040009c000008fa04008041000000c003400210000000000113019f23e323de0000040f00000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0640018f0000002007400190000000130570002900001a2d0000613d000000000801034f0000001309000029000000008a08043c0000000009a90436000000000059004b00001a290000c13d000000000006004b00001a3a0000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0003000000010355000000010020019000001a9e0000613d0000001f01400039000000600210018f0000001301200029000000000021004b00000000020000390000000102004039000009070010009c00000f7f0000213d000000010020019000000f7f0000c13d000000400010043f000000200030008c00001a860000413d00000013020000290000000002020433000000000002004b0000000003000039000000010300c039000000000032004b00001a860000c13d0000189d0000013d000008fa0030009c000008fa03008041000000400330021000000005044002100000004404400039000008fa0040009c000008fa040080410000006004400210000000000334019f000008fa0010009c000008fa01008041000000c001100210000000000113019f23e323d90000040f00000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0540018f0000002006400190000000100460002900001a710000613d000000000701034f0000001008000029000000007907043c0000000008980436000000000048004b00001a6d0000c13d000000000005004b00001a7e0000613d000000000661034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000100000003001f000300000001035500000010010000290000000001010433000000010020019000001a860000613d000000010010008c0000080c0000613d0000000001000019000023e500010430000008fa0020009c000008fa020080410000004002200210000008fa0040009c000008fa040080410000006003400210000000000223019f000008fa0010009c000008fa01008041000000c001100210000000000112019f0000000e0200002923e323d90000040f000000010220018f00030000000103550000006001100270000108fa0010019d000008fa0310019800001ab70000c13d000f00600000003d000a00800000003d00001ae10000013d0000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00001aa50000c13d00000c950000013d000008fa033001970000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00001ab20000c13d00000c950000013d000000400100043d000f00000001001d0000001f013000390000098c011001970000003f011000390000098d041001970000000f01400029000000000041004b00000000040000390000000104004039000009070010009c00000f7f0000213d000000010040019000000f7f0000c13d000000400010043f0000000f010000290000000005310436000009cf043001980000001f0330018f000a00000005001d0000000001450019000000030500036700001ad40000613d000000000605034f0000000a07000029000000006806043c0000000007870436000000000017004b00001ad00000c13d000000000003004b00001ae10000613d000000000445034f0000000303300210000000000501043300000000053501cf000000000535022f000000000404043b0000010003300089000000000434022f00000000033401cf000000000353019f00000000003104350000000f010000290000000001010433000000000002004b00001aea0000c13d000000000001004b00001b7b0000c13d000000400100043d0000099002000041000003b60000013d000000000001004b00001b880000c13d000009030100004100000000001004430000000e0100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f000000010020019000001b7a0000613d000000000101043b000000000001004b00001b840000c13d000000400100043d0000098f020000410000061b0000013d000009a001000041000a0000000a001d00000000001a04350000000401a00039000000200200003900000000002104350000002402a00039000000110100002923e31c3b0000040f0000000a02000029000014660000013d0000098b0030009c00000f7f0000213d000000a001300039000000400010043f00000080013000390000001202000029000000000021043500000060023000390000001105000029000000000052043500000040053000390000000e0600002900000000006504350000002006300039000000000046043500000010040000290000000000430435000009aa04000041000000400800043d0000000004480436001000000004001d0000000404800039000000400700003900000000007404350000000003030433000008fa033001970000004404800039000000000034043500000000030604330000006404800039000000000034043500000000030504330000008404800039000000a0050000390000000000540435000000e40480003900000000350304340000000000540435001100000008001d0000010404800039000000000005004b00001b3c0000613d000000000600001900000000074600190000000008630019000000000808043300000000008704350000002006600039000000000056004b00001b350000413d0000000003000410000000000645001900000000000604350000001f05500039000009cf0550019700000000020204330000001106000029000000a406600039000000c0075000390000000000760435000000000445001900000000250204340000000004540436001300000004001d001200000005001d000000000005004b00001b550000613d000000000400001900000013054000290000000006420019000000000606043300000000006504350000002004400039000000120040006c00001b4e0000413d0000001204000029000000130240002900000000000204350000000001010433000008fe02300197000000110400002900000024034000390000000000230435000000c402400039000000000001004b0000000001000039000000010100c03900000000001204350000096401000041000000000010044300000000010004120000000400100443000000200100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f000000010020019000001b7a0000613d000000000201043b0000000001000414000008fe02200197000000040020008c00001b980000c13d0000000104000031000000400040008c000000400400803900001bcc0000013d000000000001042f0000000a02000029000008fa0020009c000008fa020080410000004002200210000008fa0010009c000008fa010080410000006001100210000000000121019f000023e5000104300000000f010000290000000001010433000000000001004b000015830000613d000009850010009c00001a860000213d000000200010008c00001a860000413d0000000a010000290000000001010433000000000001004b0000000002000039000000010200c039000000000021004b00001a860000c13d000000000001004b000015830000c13d000000400100043d0000098e020000410000061b0000013d00000012030000290000001f03300039000009cf03300197000000110500002900000013045000690000000003340019000008fa0030009c000008fa030080410000006003300210000008fa0050009c000008fa0400004100000000040540190000004004400210000000000343019f000008fa0010009c000008fa01008041000000c001100210000000000131019f23e323de0000040f00000000030100190000006003300270000008fa03300197000000400030008c000000400400003900000000040340190000001f0640018f0000006007400190000000110570002900001bbb0000613d000000000801034f0000001109000029000000008a08043c0000000009a90436000000000059004b00001bb70000c13d000000000006004b00001bc80000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f0003000000010355000000010020019000001c2f0000613d0000001f01400039000000e00210018f0000001101200029000000000021004b00000000020000390000000102004039000009070010009c00000f7f0000213d000000010020019000000f7f0000c13d000000400010043f000000400040008c00001a860000413d000009700010009c00000f7f0000213d0000004002100039000000400020043f000000110200002900000000020204330000000001210436000000100300002900000000030304330000000000310435000000400300043d000000000223043600000000010104330000000000120435000008fa0030009c000008fa030080410000004001300210000009ab011001c7000023e40001042e000008fa0030009c000008fa03008041000000400330021000000005044002100000004404400039000008fa0040009c000008fa040080410000006004400210000000000334019f000008fa0010009c000008fa01008041000000c001100210000000000113019f23e323d90000040f000a00000002001d00000000020100190000006002200270000008fa02200197000000200020008c000000200300003900000000030240190000001f0430018f0000002005300190000000100350002900001c0b0000613d000000000601034f0000001007000029000000006806043c0000000007870436000000000037004b00001c070000c13d000000000004004b00001c180000613d000000000551034f0000000304400210000000000603043300000000064601cf000000000646022f000000000505043b0000010004400089000000000545022f00000000044501cf000000000464019f0000000000430435000100000002001f0003000000010355000000100100002900000000010104330000000a02000029000000010020019000001a860000613d000000010010008c0000136d0000613d00001a860000013d000008fa033001970000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00001c2a0000c13d00000c950000013d0000001f0530018f000008fc06300198000000400200043d000000000462001900000c950000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b00001c360000c13d00000c950000013d00000000430104340000000001320436000000000003004b00001c470000613d000000000200001900000000051200190000000006240019000000000606043300000000006504350000002002200039000000000032004b00001c400000413d000000000213001900000000000204350000001f02300039000009cf022001970000000001210019000000000001042d00000020030000390000000004310436000000003202043400000000002404350000004001100039000000000002004b00001c5c0000613d000000000400001900000000051400190000000006430019000000000606043300000000006504350000002004400039000000000024004b00001c550000413d000000000312001900000000000304350000001f02200039000009cf022001970000000001120019000000000001042d0000001f03100039000000000023004b00000000040000190000099a040040410000099a052001970000099a03300197000000000653013f000000000053004b00000000030000190000099a030020410000099a0060009c000000000304c019000000000003004b00001c7a0000613d0000000203100367000000000303043b000009070030009c00001c7a0000213d00000020011000390000000004310019000000000024004b00001c7a0000213d0000000002030019000000000001042d0000000001000019000023e5000104300000ffff0220018f000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001c8a0000613d000000000101043b000000000001042d0000000001000019000023e5000104300003000000000002000000000201041a000000010320019000000001062002700000007f0660618f0000001f0060008c00000000040000390000000104002039000000000043004b00001ccb0000c13d000000400500043d0000000004650436000000000003004b00001cb60000613d000100000004001d000300000006001d000200000005001d000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f000000010020019000001cd70000613d0000000306000029000000000006004b00001cbc0000613d000000000201043b0000000001000019000000020500002900000001070000290000000003170019000000000402041a000000000043043500000001022000390000002001100039000000000061004b00001cae0000413d00001cbe0000013d000009d0012001970000000000140435000000000006004b0000002001000039000000000100603900001cbe0000013d000000000100001900000002050000290000003f01100039000009cf021001970000000001520019000000000021004b00000000020000390000000102004039000009070010009c00001cd10000213d000000010020019000001cd10000c13d000000400010043f0000000001050019000000000001042d000009a101000041000000000010043f0000002201000039000000040010043f0000090601000041000023e500010430000009a101000041000000000010043f0000004101000039000000040010043f0000090601000041000023e5000104300000000001000019000023e500010430000008fe01100197000000000010043f000009ae01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001ce80000613d000000000101043b000000000001042d0000000001000019000023e500010430000008fe01100197000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001cf90000613d000000000101043b000000000001042d0000000001000019000023e500010430000008fe02200197000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001d090000613d000000000101043b000000000001042d0000000001000019000023e5000104300001000000000002000100000002001d000008fa01100197000000000010043f0000000101000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001d200000613d000000000101043b000000000101041a000000010010006c00000000010000390000000101006039000000000001042d0000000001000019000023e5000104300005000000000002000500000004001d000400000003001d000300000002001d000008fa01100197000000000010043f0000000301000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001e240000613d000000000101043b00000003020000290000ffff0220018f000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f000000010020019000001e240000613d000000000101043b000000000201041a000000010320019000000001062002700000007f0660618f0000001f0060008c00000000040000390000000104002039000000000043004b00001e2c0000c13d000000400700043d0000000005670436000000000003004b00001d6c0000613d000100000006001d000200000007001d000300000005001d000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f000000010020019000001e240000613d0000000108000029000000000008004b00001d730000613d000000000201043b00000000010000190000000506000029000000030500002900000002070000290000000003150019000000000402041a000000000043043500000001022000390000002001100039000000000081004b00001d640000413d00001d770000013d000009d0012001970000000000150435000000000006004b00000020010000390000000001006039000000050600002900001d770000013d00000000010000190000000506000029000000030500002900000002070000290000003f01100039000009cf031001970000000001730019000000000031004b00000000030000390000000103004039000009070010009c00001e260000213d000000010030019000001e260000c13d000000400010043f0000000003070433000000000003004b00001df70000613d000000000006004b00001e220000613d000000010060008c00001e320000613d000009070060009c00001e260000213d0000001f03600039000009cf033001970000003f03300039000009cf033001970000000003310019000009070030009c00001e260000213d000000000e070019000000000d050019000000400030043f00000000046104360000000403600029000000000030007c00001e240000213d00000002030003670000000406300360000000050c000029000009cf07c001980000001f08c0018f000000000574001900001da60000613d000000000906034f000000000a040019000000009b09043c000000000aba043600000000005a004b00001da20000c13d000000000008004b00001db30000613d000000000676034f0000000307800210000000000805043300000000087801cf000000000878022f000000000606043b0000010007700089000000000676022f00000000067601cf000000000686019f00000000006504350000000004c400190000000000040435000000400b00043d000000020410003900000000040404330000ffff0440018f000000030040008c00001e4a0000c13d0000002006b000390000000201c0008a00000000040e0433000000000004004b00001dc80000613d0000000005000019000000000765001900000000085d0019000000000808043300000000008704350000002005500039000000000045004b00001dc10000413d00000004050000290000000205500039000000000553034f000000000364001900000000000304350000000003b40019000009cf061001980000001f0710018f0000002008300039000000000468001900001dd80000613d000000000905034f000000009a09043c0000000008a80436000000000048004b00001dd40000c13d000000000007004b00001de50000613d000000000565034f0000000306700210000000000704043300000000076701cf000000000767022f000000000505043b0000010006600089000000000565022f00000000056501cf000000000575019f00000000005404350000000001130019000000200310003900000000000304350000000001b1004900000000001b04350000003f01100039000009cf021001970000000001b20019000000000021004b00000000020000390000000102004039000009070010009c00001e260000213d000000010020019000001e260000c13d000000400010043f00000000010b0019000000000001042d000009070060009c00001e260000213d0000001f03600039000009cf033001970000003f03300039000009cf033001970000000003310019000009070030009c00001e260000213d000000400030043f00000000036104360000000405600029000000000050007c00001e240000213d000000050a000029000009cf04a001980000001f05a0018f00000004020000290000000206200367000000000243001900001e120000613d000000000706034f0000000008030019000000007907043c0000000008980436000000000028004b00001e0e0000c13d000000000005004b00001e1f0000613d000000000446034f0000000305500210000000000602043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004204350000000002a300190000000000020435000000000001042d0000000001070019000000000001042d0000000001000019000023e500010430000009a101000041000000000010043f0000004101000039000000040010043f0000090601000041000023e500010430000009a101000041000000000010043f0000002201000039000000040010043f0000090601000041000023e500010430000000240210003900000001030000390000000000320435000009a002000041000000000021043500000004021000390000002003000039000000000032043500000044021000390000000003020433000009810330019700000004040000290000000204400367000000000404043b000009a704400197000000000334019f000000000032043500000045021000390000000000020435000008fa0010009c000008fa010080410000004001100210000009a8011001c7000023e500010430000009a00200004100000000002b04350000000402b00039000000200300003900000000003204350000002402b0003900050000000b001d23e31c3b0000040f00000005020000290000000001210049000008fa0010009c000008fa01008041000008fa0020009c000008fa0200804100000060011002100000004002200210000000000121019f000023e500010430000f000000000002000300000003001d0000000003010019000200000002001d000508fe0020019c000020f80000613d000a00000003001d000008fe01300197000400000001001d000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d000000000101043b000f00000001001d000000000101041a000009690010019800001e8c0000c13d000009030100004100000000001004430000000a0100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f0000000100200190000020eb0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000000f03000029000000000203041a0000096b02200197000000000112019f000000000013041b0000000501000029000000000010043f0000096701000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d000000000101043b000600000001001d000000000101041a000009690010019800001eb40000c13d00000903010000410000000000100443000000020100002900000004001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000904011001c7000080020200003923e323de0000040f0000000100200190000020eb0000613d000000000101043b000000000001004b0000096a0100004100000969010060410000000603000029000000000203041a0000096b02200197000000000112019f000000000013041b000000400400043d000009d20040009c000020f20000813d000000c002400039000000400020043f000000600640003900000000000604350000002002400039000700000002001d000000000002043500000000000404350000000f05000029000000000205041a0000008001100270000008fa01100197000000a003400039000900000003001d00000000001304350000008001200270000008fa031001970000008001400039000800000001001d000c00000003001d0000000000310435000e00000004001d0000004001400039000000a0032002700000000000310435000000030730006c0000000303000029000020fb0000413d0000000000710435000008fe01200197000b00000007001d000000a002700210000000000112019f000000000015041b0000000604000029000000000104041a000000a0021002700000000002320019000100000006001d0000000000260435000000a002200210000008fe01100197000000000112019f000000000014041b0000090d01000041000000000101041a000d00000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f0000000100200190000020eb0000613d000000000101043b0000000d020000290000004002200270000008fd0320019700000000013100aa0000000e06000029000020ec0000613d0000000b011000f90000000c0110006b000000000100401900000000001604350000000602000029000000000202041a0000096e0020019800001f270000c13d000c00000003001d0000000403000029000000050030006c00001f0c0000c13d00000008020000290000000002020433000000000112004900000009020000290000000000120435000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f0000000100200190000020eb0000613d000000000101043b0000000c011000ba0000000e06000029000020ec0000613d0000000102000029000000000202043300000000011200d900000009020000290000000002020433000000000121004b000000000100401900000007020000290000000000120435000000400400043d000009700040009c000020f20000213d0000000701000029000000000101043300000000020604330000004003400039000000400030043f0000006003000039000000000534043600000000012100190000000000050435000000400200043d00000040032000390000000000130435000000050110021000000060022000390000000001120019000000400010043f000100000004001d0000000000340435000b00000005001d00000000002504350000000001060433000000000001004b00001fb10000613d0000000401000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d0000000e020000290000000002020433000000a0032002100000000d0330006900000975033001970000090d04000041000000000504041a0000097605500197000000000353019f000000000101043b000d00000001001d00000008010000290000000005010433000000000034041b0000000001250049000c00000001001d000000800110021000000977011001970000000f03000029000000000203041a0000097802200197000000000112019f000000000013041b0000000a01000029000a0060001002180000801002000039000000010550008a000f00000005001d0000000301500270000000000010043f0000000d01000029000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c723e323de0000040f0000000100200190000020e90000613d000000000101043b000000000101041a0000097a02000041000000200020043f0000000f020000290000000502200210000000e00220018f000000000121022f000008fa01100197000e00000001001d0000000201100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d0000000e050000290000000602500210000000c00220018f000000000101043b000000000301041a000000000423022f000009070440019700000000022401cf000000000232013f000000000021041b000000000050043f0000098601000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d000000000101043b000000000201041a0000090002200197000000000021041b0000000e0100002900000008011002100000000a011001af00000001011001bf0000000b030000290000000002030433000000000112043600000000001304350000000f050000290000000c0050006c000080100200003900001f680000c13d00000007010000290000000001010433000000000001004b0000208a0000613d0000000501000029000000000010043f0000096f01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d00000009020000290000000002020433000c00000002001d00000007020000290000000002020433000f00000002001d000000000101043b000800000001001d0000000601000029000000000101041a0000006001100270000908fa0010019c00001ff10000c13d0000090d01000041000000000201041a000008fa03200197000008fa0030009c000021030000613d00000971022001970000000104300039000000000224019f000000000021041b000000600140021000000972011001970000000603000029000000000203041a0000097302200197000000000112019f000000000013041b000900000004001d000000000040043f0000097401000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d000000000101043b000000000201041a000009000220019700000005022001af000000000021041b0000090d01000041000000000101041a000e00000001001d0000091301000041000000000101041a000d00000001001d000009640100004100000000001004430000000001000412000000040010044300000024000004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f0000000100200190000020eb0000613d000000000101043b0000000e070000290000004002700270000008fd0220019700000000012100aa000020ec0000613d0000000f030000290000000c063000290000000d02000029000008fd0220019700000007030000290000000003030433000000a003300210000000000373001900000975033001970000090d04000041000000000504041a0000097605500197000000000353019f000000000034041b000700000006001d000000800360021000000977033001970000000605000029000000000405041a0000097804400197000000000334019f000000000035041b000d0000001200e1000000020100002900060060001002180000002001700270000008fa031001970000202a0000013d00000001033000390000000d0030006c0000000103002039000f00000003001d0000000201300270000e00000001001d0000097901100197000000000010043f0000097a01000041000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d0000000f030000290000000602300210000000c00220018f000000000101043b000000000101041a000000000121022f000008fa00100198000020270000c13d000a00000002001d0000000801000029000000200010043f0000000c010000290000000301100270000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d0000000c020000290000000502200210000000e00220018f000000000101043b000000000301041a000000000423022f0000000f0440014f000008fa0440019700000000022401cf000000000232013f000000000021041b0000097a01000041000000200010043f0000000e01000029000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000020e90000613d0000000c05000029000000200250021000000009022001af000000000101043b000000000301041a0000000a04300250000000000224013f00000907022001970000000a022001f0000000000232013f000000000021041b0000000f04000029000000080140021000000006011001af0000000b0300002900000000020304330000000001120436000000000013043500000001044000390000000d0040006c00000001040020390000000105500039000c00000005001d000000070050006c00000000030400190000202a0000c13d00000020013002100000090e011001970000090d02000041000000000302041a0000097b03300197000000000113019f000000000012041b000000010100002900000000020104330000000001020433000000000001004b000020d40000613d0000091303000041000000000503041a000000200320008a00000020040000390000000000430435000000400620008a0000097c030000410000000000360435000000240420008a00000000030004140000006002500270000000040020008c000020a00000c13d000000000104043300000000001604350000000102000039000020d00000013d000008fa0040009c000008fa04008041000000400440021000000005011002100000004401100039000008fa0010009c000008fa010080410000006001100210000000000141019f000008fa0030009c000008fa03008041000000c003300210000000000113019f000f00000006001d23e323d90000040f0000000f0a00002900000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0540018f000000200640019000000000046a0019000020c00000613d000000000701034f00000000080a0019000000007907043c0000000008980436000000000048004b000020bc0000c13d000000000005004b000020cd0000613d000000000661034f0000000305500210000000000704043300000000075701cf000000000757022f000000000606043b0000010005500089000000000656022f00000000055601cf000000000575019f0000000000540435000100000003001f000300000001035500000000010a04330000000100200190000020e90000613d000000010010008c000020e90000c13d000000400100043d00000003020000290000000000210435000008fa0010009c000008fa0100804100000040011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f0000097d011001c70000800d0200003900000003030000390000097e040000410000000405000029000000050600002923e323d90000040f0000000100200190000020e90000613d000000000001042d0000000001000019000023e500010430000000000001042f000009a101000041000000000010043f0000001201000039000000040010043f0000090601000041000023e500010430000009a101000041000000000010043f0000004101000039000000040010043f0000090601000041000023e500010430000000400100043d000009cc02000041000020fd0000013d000000400100043d00000997020000410000000000210435000008fa0010009c000008fa01008041000000400110021000000910011001c7000023e500010430000009a101000041000000000010043f0000001101000039000000040010043f0000090601000041000023e5000104300007000000000002000700000002001d000600000001001d0000096401000041000000000010044300000000010004120000000400100443000000400100003900000024001004430000000001000414000008fa0010009c000008fa01008041000000c00110021000000965011001c7000080050200003923e323de0000040f0000000100200190000023580000613d000000000601043b000000000006004b000023590000613d000000060b000029000000a005b000390000000202000367000000000152034f000000000701043b000000000d0000310000000003bd00490000001f0130008a0000099a041001970000099a08700197000000000948013f000000000048004b00000000080000190000099a08002041000000000017004b000000000a0000190000099a0a0040410000099a0090009c00000000080ac019000000000008004b000023500000613d0000000008b70019000000000782034f000000000707043b000009070070009c000023500000213d00000000097d0049000000200a8000390000099a089001970000099a0ba00197000000000c8b013f00000000008b004b00000000080000190000099a0800404100000000009a004b00000000090000190000099a090020410000099a00c0009c000000000809c019000000000008004b000023500000c13d0000001f08700039000009cf088001970000003f08800039000009cf08800197000000400900043d0000000008890019000000000098004b000000000b000039000000010b004039000009070080009c000023520000213d0000000100b00190000023520000c13d000000400080043f0000000008790436000000000ba700190000000000db004b000023500000213d00050000000d001d000000000ba2034f000009cf0c7001980000001f0d70018f000000000ac80019000021650000613d000000000e0b034f000000000f08001900000000e30e043c000000000f3f04360000000000af004b000021610000c13d00000007066000f900000000000d004b000021730000613d0000000003cb034f000000030bd00210000000000c0a0433000000000cbc01cf000000000cbc022f000000000303043b000001000bb000890000000003b3022f0000000003b301cf0000000003c3019f00000000003a043500000000037800190000000000030435000000800350008a000000000332034f000000000303043b0000000005090433000000c006600210000000400a00043d0000004007a00039000000000067043500000000060a00190000002007600039000300000007001d0000000000370435000000000005004b000700000006001d000021a60000613d00000048036000390000000005000411000000000053043500000068066000390000000005090433000000000005004b000000060a000029000000050b000029000021950000613d000000000700001900000000036700190000000009870019000000000909043300000000009304350000002007700039000000000057004b0000218e0000413d000000000365001900000000000304350000004803500039000000070600002900000000003604350000008703500039000009cf033001970000000005630019000000000035004b00000000060000390000000106004039000009070050009c000023520000213d0000000100600190000023520000c13d000400020000003d000021af0000013d00000028030000390000000000360435000009870060009c000000060a000029000000050b000029000023520000213d000400010000003d00000007030000290000006005300039000000400050043f0000000003a2034f000000000503043b000008fa0050009c000023500000213d0000008003a00039000000000332034f000000000603043b0000099a03600197000000000743013f000000000043004b00000000030000190000099a03004041000000000016004b00000000040000190000099a040080410000099a0070009c000000000304c019000000000003004b000023500000c13d0000000003a60019000000000232034f000000000602043b000009070060009c000023500000213d00000000016b004900000020073000390000099a021001970000099a03700197000000000423013f000000000023004b00000000020000190000099a02004041000600000007001d000000000017004b00000000010000190000099a010020410000099a0040009c000000000201c019000000000002004b000023500000c13d000000000050043f0000000301000039000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c70000801002000039000500000006001d23e323de0000040f0000000100200190000023500000613d000000000101043b0000000402000029000000000020043f000000200010043f0000000001000414000008fa0010009c000008fa01008041000000c00110021000000968011001c7000080100200003923e323de0000040f0000000100200190000023500000613d000000000101043b000000000201041a000000010320019000000001072002700000007f0770618f0000001f0070008c00000000040000390000000104002039000000000043004b0000235f0000c13d000000400600043d0000000005760436000000000003004b0000221d0000613d000100000007001d000200000006001d000400000005001d000000000010043f0000000001000414000008fa0010009c000008fa01008041000000c0011002100000097d011001c7000080100200003923e323de0000040f0000000100200190000000050b000029000023500000613d0000000107000029000000000007004b0000000405000029000022240000613d000000000201043b000000000100001900000002060000290000000003150019000000000402041a000000000043043500000001022000390000002001100039000000000071004b000022150000413d000022260000013d000009d0012001970000000000150435000000000007004b00000020010000390000000001006039000000050b000029000022260000013d000000000100001900000002060000290000003f01100039000009cf01100197000000000a61001900000000001a004b000000000100003900000001010040390000090700a0009c000023520000213d0000000100100190000023520000c13d0000004000a0043f0000000001060433000000000001004b000022a30000613d00000000000b004b000022cb0000613d0000000100b0008c000023650000613d0000001f01b00039000009cf011001970000003f01100039000009cf0110019700000000011a0019000009070010009c000023520000213d000000000d060019000000000c050019000000400010043f0000000002ba04360000000601b00029000000000010007c000023500000213d00000002010003670000000604100360000009cf05b001980000001f06b0018f0000000003520019000022520000613d000000000704034f0000000008020019000000007907043c0000000008980436000000000038004b0000224e0000c13d000000000006004b0000225f0000613d000000000454034f0000000305600210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000002b200190000000000020435000000400e00043d0000000202a0003900000000020204330000ffff0220018f000000030020008c0000237d0000c13d0000002005e000390000000202b0008a00000000030d0433000000000003004b000022740000613d0000000004000019000000000654001900000000074c0019000000000707043300000000007604350000002004400039000000000034004b0000226d0000413d00000006040000290000000204400039000000000441034f000000000153001900000000000104350000000001e30019000009cf052001980000001f0620018f00000020071000390000000003570019000022840000613d000000000804034f000000008908043c0000000007970436000000000037004b000022800000c13d000000000006004b000022910000613d000000000454034f0000000305600210000000000603043300000000065601cf000000000656022f000000000404043b0000010005500089000000000454022f00000000045401cf000000000464019f00000000004304350000000001210019000000200210003900000000000204350000000001e1004900000000001e04350000003f01100039000009cf021001970000000001e20019000000000021004b00000000020000390000000102004039000009070010009c000023520000213d0000000100200190000023520000c13d000000400010043f000000000a0e0019000022cc0000013d0000001f01b00039000009cf011001970000003f01100039000009cf0110019700000000011a0019000009070010009c000023520000213d000000400010043f0000000001ba04360000000603b00029000000000030007c000023500000213d000009cf03b001980000001f04b0018f000000060200002900000002052003670000000002310019000022bb0000613d000000000605034f0000000007010019000000006806043c0000000007870436000000000027004b000022b70000c13d000000000004004b000022c80000613d000000000335034f0000000304400210000000000502043300000000054501cf000000000545022f000000000303043b0000010004400089000000000343022f00000000034301cf000000000353019f00000000003204350000000001b100190000000000010435000022cc0000013d000000000a0600190000000401000039000000000101041a000008fe021001980000234d0000613d000000400b00043d000009a90100004100000000001b04350000000401b0003900000040030000390000000000310435000000070300002900000000030304330000004404b0003900000000003404350000006404b00039000000000003004b0000000308000029000022e60000613d000000000500001900000000064500190000000007850019000000000707043300000000007604350000002005500039000000000035004b000022df0000413d000000000543001900000000000504350000001f03300039000009cf03300197000000000543001900000000011500490000002403b00039000000000013043500000000430a04340000000001350436000000000003004b000022fa0000613d000000000500001900000000061500190000000007540019000000000707043300000000007604350000002005500039000000000035004b000022f30000413d000000000413001900000000000404350000000004000414000000040020008c000023040000c13d0000000103000031000000200030008c000000200400003900000000040340190000233a0000013d00060000000a001d0000001f03300039000009cf033001970000000001b100490000000001310019000008fa0010009c000008fa010080410000006001100210000008fa00b0009c000008fa0300004100000000030b40190000004003300210000000000131019f000008fa0040009c000008fa04008041000000c003400210000000000113019f00050000000b001d23e323de0000040f000000050b00002900000000030100190000006003300270000008fa03300197000000200030008c000000200400003900000000040340190000001f0640018f000000200740019000000000057b0019000023280000613d000000000801034f00000000090b0019000000008a08043c0000000009a90436000000000059004b000023240000c13d000000000006004b000023350000613d000000000771034f0000000306600210000000000805043300000000086801cf000000000868022f000000000707043b0000010006600089000000000767022f00000000066701cf000000000686019f0000000000650435000100000003001f00030000000103550000000100200190000000060a000029000023900000613d0000001f01400039000000600210018f0000000001b20019000000000021004b00000000020000390000000102004039000009070010009c000023520000213d0000000100200190000023520000c13d000000400010043f000000200030008c000023500000413d00000000010b0433000000000001004b0000000002000039000000010200c039000000000021004b000023500000c13d000000070100002900000000020a0019000000000001042d0000000001000019000023e500010430000009a101000041000000000010043f0000004101000039000000040010043f0000090601000041000023e500010430000000000001042f000009a101000041000000000010043f0000001201000039000000040010043f0000090601000041000023e500010430000009a101000041000000000010043f0000002201000039000000040010043f0000090601000041000023e5000104300000002401a0003900000001020000390000000000210435000009a00100004100000000001a04350000000401a00039000000200200003900000000002104350000004401a000390000000002010433000009810220019700000006030000290000000203300367000000000303043b000009a703300197000000000223019f00000000002104350000004501a000390000000000010435000008fa00a0009c000008fa0a0080410000004001a00210000009a8011001c7000023e500010430000009a00100004100000000001e04350000000401e00039000000200200003900000000002104350000002402e0003900000000010a001900070000000e001d23e31c3b0000040f00000007020000290000000001210049000008fa0010009c000008fa01008041000008fa0020009c000008fa0200804100000060011002100000004002200210000000000121019f000023e5000104300000001f0530018f000008fc06300198000000400200043d00000000046200190000239b0000613d000000000701034f0000000008020019000000007907043c0000000008980436000000000048004b000023970000c13d000000000005004b000023a80000613d000000000161034f0000000305500210000000000604043300000000065601cf000000000656022f000000000101043b0000010005500089000000000151022f00000000015101cf000000000161019f00000000001404350000006001300210000008fa0020009c000008fa020080410000004002200210000000000112019f000023e500010430000000000001042f000008fa0010009c000008fa0100804100000060011002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f00000901011001c7000080100200003923e323de0000040f0000000100200190000023be0000613d000000000101043b000000000001042d0000000001000019000023e50001043000000000050100190000000000200443000000040100003900000005024002700000000002020031000000000121043a0000002004400039000000000031004b000023c30000413d000008fa0030009c000008fa0300804100000060013002100000000002000414000008fa0020009c000008fa02008041000000c002200210000000000112019f000009d3011001c7000000000205001923e323de0000040f0000000100200190000023d80000613d000000000101043b000000000001042d000000000001042f000023dc002104210000000102000039000000000001042d0000000002000019000000000001042d000023e1002104230000000102000039000000000001042d0000000002000019000000000001042d000023e300000432000023e40001042e000023e5000104300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff00000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000000ffffffe00000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000de0b6b3a7640000ffffffffffffffffffffffff000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000008be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e01806aa1896bbf26568e884a7374b41e002500962caba6a15023a8d90e8508b830200000200000000000000000000000000000024000000000000000000000000ca5eb5e1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000ffffffffffffff7b01000223b14496821cf0e43d1b3b4b2641ce5c1020de0d86850f62095891060a9c4d535bdea7cd8a978f128b93471df48c7dbab89d703809115bdc118c235bfd02000000000000000000000000000000000000a40000000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e5255308000000000000000000000000000000000000000000000000ffffffff00000000ead4d2e4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000f4599e500000000000000000000000000000000000000240000001c00000000000000000000000000000000000000000000000000000000000000a20d6e21d0e5255309ffffffffffffffffffffffff00000000000000000000000000000000ffffffff000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000000000000000000100000001000000000000000000534ea6190000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d125259c00000000000000000000000000000000000000040000001c000000000000000039a84a7b000000000000000000000000000000000000000000000000000000001e4fbdf7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070a0823000000000000000000000000000000000000000000000000000000000bb0b6a5200000000000000000000000000000000000000000000000000000000d045a0db00000000000000000000000000000000000000000000000000000000f2fde38a00000000000000000000000000000000000000000000000000000000f2fde38b00000000000000000000000000000000000000000000000000000000fc0c546a00000000000000000000000000000000000000000000000000000000ff7bd03d00000000000000000000000000000000000000000000000000000000d045a0dc00000000000000000000000000000000000000000000000000000000d424388500000000000000000000000000000000000000000000000000000000dd62ed3e00000000000000000000000000000000000000000000000000000000c7c7f5b200000000000000000000000000000000000000000000000000000000c7c7f5b300000000000000000000000000000000000000000000000000000000c87b56dd00000000000000000000000000000000000000000000000000000000ca5eb5e100000000000000000000000000000000000000000000000000000000bb0b6a5300000000000000000000000000000000000000000000000000000000bc70b35400000000000000000000000000000000000000000000000000000000bd815db00000000000000000000000000000000000000000000000000000000095d89b4000000000000000000000000000000000000000000000000000000000a9059cba00000000000000000000000000000000000000000000000000000000a9059cbb00000000000000000000000000000000000000000000000000000000b731ea0a00000000000000000000000000000000000000000000000000000000b98bd0700000000000000000000000000000000000000000000000000000000095d89b4100000000000000000000000000000000000000000000000000000000963efcaa000000000000000000000000000000000000000000000000000000009f68b9640000000000000000000000000000000000000000000000000000000082413eab0000000000000000000000000000000000000000000000000000000082413eac00000000000000000000000000000000000000000000000000000000857749b0000000000000000000000000000000000000000000000000000000008da5cb5b0000000000000000000000000000000000000000000000000000000070a0823100000000000000000000000000000000000000000000000000000000715018a6000000000000000000000000000000000000000000000000000000007d25a05e000000000000000000000000000000000000000000000000000000002a6a935c0000000000000000000000000000000000000000000000000000000052ae2878000000000000000000000000000000000000000000000000000000005a0dfe4c000000000000000000000000000000000000000000000000000000005a0dfe4d000000000000000000000000000000000000000000000000000000005e280f11000000000000000000000000000000000000000000000000000000006fc1b31e0000000000000000000000000000000000000000000000000000000052ae2879000000000000000000000000000000000000000000000000000000005535d4610000000000000000000000000000000000000000000000000000000055f804b3000000000000000000000000000000000000000000000000000000003b6f743a000000000000000000000000000000000000000000000000000000003b6f743b00000000000000000000000000000000000000000000000000000000444d9172000000000000000000000000000000000000000000000000000000004ef41efc000000000000000000000000000000000000000000000000000000002a6a935d00000000000000000000000000000000000000000000000000000000313ce567000000000000000000000000000000000000000000000000000000003400288b00000000000000000000000000000000000000000000000000000000156a0d0e000000000000000000000000000000000000000000000000000000001f5e1333000000000000000000000000000000000000000000000000000000001f5e13340000000000000000000000000000000000000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000274e430b00000000000000000000000000000000000000000000000000000000156a0d0f0000000000000000000000000000000000000000000000000000000017442b700000000000000000000000000000000000000000000000000000000018160ddd00000000000000000000000000000000000000000000000000000000111ecdac00000000000000000000000000000000000000000000000000000000111ecdad0000000000000000000000000000000000000000000000000000000013137d6500000000000000000000000000000000000000000000000000000000134d4f250000000000000000000000000000000000000000000000000000000006fdde0300000000000000000000000000000000000000000000000000000000095ea7b3000000000000000000000000000000000000000000000000000000000d35b4150000000000000000000000000000000000000020000000800000000000000000118cdaa700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002400000080000000000000000000000000000000000000000000000000000000200000000000000000000000000200000000000000000000000000000000000020000000800000000000000000d48d879cef83a1c0bdda516f27b13ddb1b3f8bbac1c9e1511bb2a659c242776014d4a4e8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000310ab089e4439a4c15d089f94afb7896ff553aecb10793d0ab882de59d99a32e020000020000000000000000000000000000004400000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e5255310020000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000ffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffff00000000000000000000000000000000000000000de0b6b39983494c589bffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000a20d6e21d0e525530e000000000000000000000000000000000000000000000000ffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000ffffffff000000000000000000000000ffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000a20d6e21d0e525530a0000000000000000ffffffff0000000000000000000000000000000000000000ffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000ffffffff00000000000000000000000000000000ffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000a20d6e21d0e525530fffffffffffffffffffffffffffffffffffffffffffffffff00000000ffffffff00000000000000000000000000000000000000000000000000000000263c69d60200000000000000000000000000000000000020000000000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef7cb5901200000000000000000000000000000000000000000000000000000000efed6d3500546b29533b128a29e3a94d70788727f0507505ac12eaf2e578fd9c00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3000000000000000000000000000000000000000000000000000000000000000036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db02e6a736f6e0000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000a20d6e21d0e525530c000000000000000000000000000000000000000000000000ffffffffffffff9f9f70412000000000000000000000000000000000000000000000000000000000e4fe1d940000000000000000000000000000000000000000000000000000000023b872dd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffff5f000000000000000000000000000000000000000000000001ffffffffffffffe0000000000000000000000000000000000000000000000003ffffffffffffffe05274afe7000000000000000000000000000000000000000000000000000000009996b315000000000000000000000000000000000000000000000000000000001425ea42000000000000000000000000000000000000000000000000000000005373352a000000000000000000000000000000000000000000000000000000002637a45000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000006000000000000000000000000085496b760a4b7f8d66384b9df21b381f5d1b1e79f229a47aaf4c232edc2fe59a00000000000000000000000000000000000000c0000000000000000000000000f6ff4fb700000000000000000000000000000000000000000000000000000000f4d678b80000000000000000000000000000000000000000000000000000000071c4efed0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000440000000000000000000000008000000000000000000000000000000000000000000000000000000000000000d045a0dc000000000000000000000000000000000000000000000000000000008e9e7099000000000000000000000000000000000000000000000000000000008351eea7000000000000000000000000000000000000000000000000000000007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000ffffffffffffff7f9a6d49cd000000000000000000000000000000000000000000000000000000004e487b7100000000000000000000000000000000000000000000000000000000be4864a8e820971c0247f5992e2da559595f7bf076a21cb5928d443d2a13b674424f4e53414900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000f0be4f1e87349231d80c36b33f9e8639658eeaf474014dee15a3e6a4d4414197fc949c7b4a13586e39d89eead2f38644f9fb3efb5a0490b14f8fc0ceab44c250ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000043a78eb00000000000000000000000000000000000000000000000000000000ddc28c58000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98bb5a1de456fff688115a4f75380060c23c8532d14ff85f687cc871456d64203930000000000000000000000000000000000000000000000a20d6e21d0e525530d13be252b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000080000000000000000002e49c2c0000000000000000000000000000000000000000000000000000000091ac5e4f00000000000000000000000000000000000000000000000000000000c26bebcc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b39983494c589c0000e5cfe957000000000000000000000000000000000000000000000000000000008c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925426f6e73616920546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d10b6e0b00000000000000000000000000000000000000000000000000000000e5eb36c700000000000000000000000000000000000000000000000000000000e5eb36c800000000000000000000000000000000000000000000000000000000f5b100ea00000000000000000000000000000000000000000000000000000000e985e9c500000000000000000000000000000000000000000000000000000000d10b6e0c00000000000000000000000000000000000000000000000000000000e2c7928100000000000000000000000000000000000000000000000000000000813500fb00000000000000000000000000000000000000000000000000000000813500fc00000000000000000000000000000000000000000000000000000000b7a94eb800000000000000000000000000000000000000000000000000000000081812fc000000000000000000000000000000000000000000000000000000006352211e0000000000000000000000000000000000000000000000a20d6e21d0e525530bcfb3b94200000000000000000000000000000000000000000000000000000000a11481000000000000000000000000000000000000000000000000000000000059c896be00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000001000000000000000000000000000000000000000000000000000000001fffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fffffffeea553b3400000000000000000000000000000000000000000000000000000000ceea21b600000000000000000000000000000000000000000000000000000000ce5a776b00000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffff400200000200000000000000000000000000000000000000000000000000000000e1ee996e1b7e08aebe58b8268d10cfe612ceb9484800d56cdb981f2bf9075d53
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000d07c30af3ff30d96bdc9c6044958230eb797ddbf00000000000000000000000021af1185734d213d45c6236146fb81e2b0e8b821
-----Decoded View---------------
Arg [0] : _tokensPerNft (uint96): 100000
Arg [1] : _lzEndpoint (address): 0xd07C30aF3Ff30D96BDc9c6044958230Eb797DDBF
Arg [2] : _delegate (address): 0x21aF1185734D213D45C6236146fb81E2b0E8b821
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [1] : 000000000000000000000000d07c30af3ff30d96bdc9c6044958230eb797ddbf
Arg [2] : 00000000000000000000000021af1185734d213d45c6236146fb81e2b0e8b821
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.