Skip to content

Commit 9f55118

Browse files
author
Weiwu Zhang
committed
allowing <source> element in activity cards, per tokenscript meeting #39
1 parent 5c260b1 commit 9f55118

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

ERCs/ERC20/ERC20-TokenScript.xml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax>
9090
</ts:type>
9191
<ts:origins>
92-
<ethereum:event type="Approval" filter="${to}=${ownerAddress}" select="to"/>
92+
<ethereum:event type="Approval" filter="${to}=${ownerAddress}"/>
9393
</ts:origins>
9494
</ts:attribute>
9595
<ts:item-view xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
@@ -103,22 +103,12 @@
103103
</ts:card>
104104

105105
<ts:card type="activity" name="approvalObtained">
106-
<ts:attribute name="amount">
107-
<ts:type>
108-
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax>
109-
</ts:type>
110-
<ts:origins>
111-
<ethereum:event type="Approval" filter="${to}=${ownerAddress}" select="amount"/>
112-
</ts:origins>
113-
</ts:attribute>
114-
<ts:attribute name="from">
115-
<ts:type>
116-
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax>
117-
</ts:type>
118-
<ts:origins>
119-
<ethereum:event type="Approval" filter="${to}=${ownerAddress}" select="from"/>
120-
</ts:origins>
121-
</ts:attribute>
106+
<!-- attributes like amount, from, to shouldn't need to be
107+
defined here because they are implied -->
108+
<ts:source>
109+
<!-- contract="…" is missing, this might be a problem -->
110+
<ethereum:event type="Approval" filter="${to}=${ownerAddress}" />
111+
</ts:source>
122112
<ts:item-view xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
123113
<style type="text/css">&style;</style>
124114
<script type="text/javascript">&item-view-approvalObtained.en;</script>

schema/tokenscript.xsd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<element name="card">
6767
<complexType>
6868
<sequence>
69+
<element ref="asnx:module" minOccurs="0" maxOccurs="unbounded"/>
6970
<element minOccurs="0" name="label" type="ts:text"/>
7071
<element minOccurs="0" maxOccurs="unbounded" ref="ts:attribute"/>
7172
<element minOccurs="0" maxOccurs="unbounded" ref="ts:selection"/>
@@ -253,7 +254,7 @@
253254
</element>
254255
<!-- label is not needed if the attribute is only used for selection -->
255256
<element minOccurs="0" name="label" type="ts:text"/>
256-
<element ref="ts:origins"/>
257+
<element minOccurs="0" ref="ts:origins"/>
257258
</sequence>
258259
<attribute name="name" use="required" type="NCName"/>
259260
<attribute name="oid" type="NMTOKEN"/>

0 commit comments

Comments
 (0)