Skip to content

Commit f4d16ea

Browse files
Merge pull request #143 from ethscriptions-protocol/fix_collections
Update Address Validation and Metadata Descriptions in Contracts
2 parents 124b55e + 423fd7c commit f4d16ea

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/models/erc721_ethscriptions_collection_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def validate_bytes32(value, field_name)
508508
end
509509

510510
def validate_address(value, field_name)
511-
unless value.is_a?(String) && value.match?(/\A0x[0-9a-f]{40}\z/)
511+
unless value.is_a?(String) && value.match?(/\A0x[0-9a-f]{40}\z/i)
512512
raise ValidationError, "Invalid address for #{field_name}: #{value}"
513513
end
514514

contracts/src/NameRegistry.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ contract NameRegistry is ERC721EthscriptionsEnumerableUpgradeable, IProtocolHand
197197
bytes memory json = abi.encodePacked(
198198
'{"name":"',
199199
name.escapeJSON(),
200-
'","description":"Dotless word domain"',
200+
'","description":"An Ethscriptions name"',
201201
',"ethscription_id":"',
202202
ethscriptionIdHex,
203203
'","ethscription_number":',
@@ -207,9 +207,9 @@ contract NameRegistry is ERC721EthscriptionsEnumerableUpgradeable, IProtocolHand
207207
'":"',
208208
mediaUri,
209209
'","attributes":[',
210-
'{"trait_type":"Name","value":"',
211-
name.escapeJSON(),
212-
'"}',
210+
'{"trait_type":"Length","value":',
211+
bytes(name).length.toString(),
212+
',"display_type":"number"}',
213213
']}'
214214
);
215215

@@ -223,7 +223,7 @@ contract NameRegistry is ERC721EthscriptionsEnumerableUpgradeable, IProtocolHand
223223
'data:application/json;base64,',
224224
Base64.encode(bytes(
225225
'{"name":"Word Domains Registry",'
226-
'"description":"On-chain word domain name system for Ethscriptions. Register unique, dotless domain names as NFTs.",'
226+
'"description":"On-chain name system for Ethscriptions. Allowed characters: a-z, 0-9, and _ (underscore). Max length: 30 characters.",'
227227
'"image":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjUwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iNTAwIiBoZWlnaHQ9IjUwMCIgZmlsbD0iIzEwMTAxMCIvPjx0ZXh0IHg9IjI1MCIgeT0iMjUwIiBmb250LXNpemU9IjgwIiBmb250LWZhbWlseT0ibW9ub3NwYWNlIiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmaWxsPSIjMDBmZjAwIj5bTkFNRVNdPC90ZXh0Pjwvc3ZnPg==",'
228228
'"external_link":"https://ethscriptions.com"}'
229229
))

0 commit comments

Comments
 (0)