TokenScript icon indicating copy to clipboard operation
TokenScript copied to clipboard

in all occurance of `<contract name="xxx"` in our examples, change xxx to `balance-holding-contract`

Open SmartLayer opened this issue 6 years ago • 0 comments
trafficstars

This is a learning path bug. There is an unnecessary difficulty in the learning of TokenScript.

@jzaki asked:

Does anyone know where these appear in the app?

  • <ts:contract interface="erc20" name="KyberNetworkCrystal"> and
  • ts:origins <ts:ethereum contract="KyberNetworkCrystal">

I didn't think it was a problem because it's apparent to me that any value in an XML tag's attribute is not meant to be displayed†. Until @jameszaki points out, then I realised there is a learning path bug.

I suggest changing KyberNetworkCrystal along with all the references to it to holding in our examples.

The point is to disabiguit it from the displayable name in <token><name>...</name></token>

-- † as an XML thing, anything that can be displayed can be extended, therefore can't be a value of an attribute.

In XML, attributes are never displayed on the UI, only content of a node will. e.g.

<person name="person1"><name>David Lloyd</name></person>

the word "person1" never would appear on the UI for the end-user.

The basic reason behind it is that you can't extend an attribute. e.g. you can later extend that to `

<person><name><givenName>Dvaid</givenName><surname>Lloyd</surname></name></person>

You can later also extend that to

<person><name>David <strong>Lloyd</strong></name></person>

or

<person><name sortKey="lloyd">David Lloyd</name></person>

If someone designed it like <person name="David Lloyd"> then he will not be able to extend that XML. After all, eXensible ML must be "extensible".

SmartLayer avatar Sep 05 '19 05:09 SmartLayer