creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "TNSFieldMaker.sol": {
        "content": "/// raffy.eth\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\ncontract TNSFieldMaker {\n\n\tuint8 constant KIND_FLAG_STRING    = 0x80;\n\tuint8 constant KIND_FLAG_NO_DECODE = 0x40;\n\tuint8 constant KIND_FLAG_SKIP_4    = 0x20;\n\tuint8 constant KIND_FLAG_ENCODED   = 0x10;\n\n\tuint8 constant KIND_TEXT = 0x01 | KIND_FLAG_STRING;\n\tuint8 constant KIND_COIN = 0x02 | KIND_FLAG_SKIP_4;\n\n\tfunction encodeTextField(string calldata name) pure external returns (bytes memory) {\n\t\treturn abi.encodePacked(KIND_TEXT, name);\n\t}\n\tfunction encodeAddrField(string calldata name, uint256 coinType) pure external returns (bytes memory) {\n\t\tif (coinType < 0x100000000) {\n\t\t\treturn abi.encodePacked(KIND_COIN, uint32(coinType), name);\n\t\t} else {\n\t\t\treturn abi.encodePacked(KIND_FLAG_ENCODED, abi.encode(name, abi.encodeWithSelector(0xf1cb7e06, 0, coinType)));\n\t\t}\n\t}\n\tfunction encodeHexBytesSelector(string calldata name, bytes4 selector, bool raw) pure external returns (bytes memory) {\n\t\treturn abi.encodePacked(KIND_FLAG_SKIP_4 | (raw ? KIND_FLAG_NO_DECODE : 0), selector, name);\n\t}\n\n\t// text(name)\t\t0x816e616d65\n\t// text(avatar)\t\t0x81617661746172\n\n\t// $eth\t\t\t\t0x220000003c24657468 \n\t// $btc\t\t\t\t0x220000000024627463 \n\t// $op\t\t\t\t0x228000000A246F70\n\n\t// #contenthash\t\t0x20bc1c58d123636f6e74656e7468617368\n\t// #pubkey\t\t\t0x60c8690233237075626b6579\n\t// #addr\t\t\t0x603b3b57de2361646472\n\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}