forked from BitcoinHEX/tokenscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.xml
110 lines (109 loc) · 3.75 KB
/
main.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE token [
<!ENTITY token.en SYSTEM "main.en.shtml">
<!ENTITY style SYSTEM "../shared.css">
]>
<ts:token xmlns:ts="http://tokenscript.org/2019/05/tokenscript"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xsi:schemaLocation="http://tokenscript.org/2019/05/tokenscript"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
custodian="false"
>
<ts:name>
<ts:plurals xml:lang="en">
<ts:string quantity="one">Token</ts:string>
<ts:string quantity="other">Tokens</ts:string>
</ts:plurals>
<ts:plurals xml:lang="es">
<ts:string quantity="one">simbólico</ts:string>
<ts:string quantity="other">Tokens</ts:string>
</ts:plurals>
<ts:string xml:lang="zh">代币</ts:string>
</ts:name>
<ts:contract name="ERC20Token" interface="erc20">
<ts:address network="1">0xdecafbad00000000000000000000000000000000</ts:address>
<ts:address network="3">0xdecafbad00000000000000000000000000000000</ts:address>
<ts:address network="4">0xdecafbad00000000000000000000000000000000</ts:address>
<ts:address network="42">0xdecafbad00000000000000000000000000000000</ts:address>
</ts:contract>
<ts:origins>
<!-- Define the contract which holds the token that the user will use -->
<ts:ethereum contract="ERC20Token">
</ts:ethereum>
</ts:origins>
<ts:selections>
<ts:selection id="expired">
<ts:name>
<ts:plurals xml:lang="en">
<ts:string quantity="one">Expired Token</ts:string>
<ts:string quantity="other">Expired Tokens</ts:string>
</ts:plurals>
<ts:string xml:lang="zh">过期的代币</ts:string>
</ts:name>
<ts:filter>expired</ts:filter>
</ts:selection>
</ts:selections>
<ts:cards>
<ts:token-card>
<style type="text/css">&style;</style>
<ts:view-iconified xml:lang="en">
&token.en;
</ts:view-iconified>
<ts:view xml:lang="en">
&token.en;
</ts:view>
</ts:token-card>
<ts:action>
<!-- this action is of the model confirm-back.
It should be <ts:action model="confirm-back"> but Weiwu
shied away from specifying that due to the likely change of design causing an upgrade path issue.
window.onConfirm is called if user hit "confirm";
window.close() causes the back button to be pressed.
-->
<ts:name>
<ts:string xml:lang="en">Enter</ts:string>
<ts:string xml:lang="zh">入場</ts:string>
<ts:string xml:lang="es">Entrar</ts:string>
</ts:name>
<style type="text/css">&style;</style>
<ts:view xml:lang="en">
<p>Do something here, like prove ownership of the token with a signature!</p>
<script>
web3.personal.sign("fun with TokenScript", function (err, data) {
console.log("Resulting signature: " + data);
});
</script>
</ts:view>
</ts:action>
</ts:cards>
<ts:attribute-types>
<ts:attribute-type id="balance" syntax="1.3.6.1.4.1.1466.115.121.1.36">
<ts:name>
<ts:string xml:lang="en">Balance</ts:string>
<ts:string xml:lang="zh">餘額</ts:string>
</ts:name>
<ts:origins>
<ts:ethereum function="balanceOf" contract="ERC20Token">
<ts:inputs>
<ts:uint256 ref="ownerAddress"/>
</ts:inputs>
</ts:ethereum>
</ts:origins>
</ts:attribute-type>
<ts:attribute-type id="expired" syntax="1.3.6.1.4.1.1466.115.121.1.7"> <!-- boolean -->
<ts:origins>
<ts:ethereum function="isExpired" contract="ERC20Token">
</ts:ethereum>
</ts:origins>
<ts:mapping>
<ts:option key="0">
<ts:value>FALSE</ts:value>
</ts:option>
<ts:option key="1">
<ts:value>TRUE</ts:value>
</ts:option>
</ts:mapping>
</ts:attribute-type>
</ts:attribute-types>
</ts:token>