Skip to content

Commit

Permalink
Allow $ and : in symbol and name respectively (Uniswap#27)
Browse files Browse the repository at this point in the history
* Allow `$` and `:` in symbol and name respectively

This will allow tokens such as `DMM: Governance` and `$TRDL`.

* fix: use double slash to escape

* test: include $ and : in special characters test
  • Loading branch information
eccentricexit authored Nov 11, 2020
1 parent 61e2605 commit 20e1c02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tokenlist.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@
"description": "The name of the token",
"minLength": 1,
"maxLength": 40,
"pattern": "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ]+$",
"pattern": "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ\\:]+$",
"examples": [
"USD Coin"
]
},
"symbol": {
"type": "string",
"description": "The symbol for the token; must be alphanumeric",
"pattern": "^[a-zA-Z0-9+\\-%/]+$",
"pattern": "^[a-zA-Z0-9+\\-%/\\$]+$",
"minLength": 1,
"maxLength": 20,
"examples": [
Expand Down
14 changes: 14 additions & 0 deletions test/schema/example-name-symbol-special-characters.tokenlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@
"symbol": "DIACRITIC",
"name": "Ázertíyuöp",
"decimals": 18
},
{
"chainId": 1,
"address": "0xEd91879919B71bB6905f23af0A68d231EcF87b14",
"symbol": "DMG",
"name": "DMM: Governance",
"decimals": 18
},
{
"chainId": 1,
"address": "0x297D33e17e61C2Ddd812389C2105193f8348188a",
"symbol": "$TRDL",
"name": "Strudel Finance",
"decimals": 18
}
],
"version": {
Expand Down

0 comments on commit 20e1c02

Please sign in to comment.