Skip to content

add COMP claim #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions examples/erc20/COMP/COMP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!ENTITY style SYSTEM "shared.css">
<!ENTITY about.en SYSTEM "about.en.js">
<!ENTITY delegate.en SYSTEM "delegate.en.js">
<!ENTITY claim.en SYSTEM "claim.en.js">
]>
<ts:token
xmlns:ts="http://tokenscript.org/2020/06/tokenscript"
Expand All @@ -17,12 +18,15 @@
</ts:label>
<ts:contract interface="erc20" name="COMP">
<ts:address network="1">0xc00e94Cb662C3520282E6f5717214004A7f26888</ts:address>
<!--mainnet-->
</ts:contract>

<ts:contract name="Comptroller">
<ts:address network="1">0x3d9819210A31b4961b30EF54bE2aeD79B9c9Cd3B</ts:address>
</ts:contract>

<ts:origins>
<!-- Define the contract which holds the token that the user will use -->
<ts:ethereum contract="COMP"/>
<!-- as above ts:contract name -->
</ts:origins>
<ts:cards>
<ts:card type="action">
Expand All @@ -34,6 +38,24 @@
<script type="text/javascript">&about.en;</script>
</ts:view>
</ts:card>

<ts:card type="action">
<ts:label>
<ts:string xml:lang="en">Claim COMP</ts:string>
</ts:label>
<ts:transaction>
<ethereum:transaction function="claimComp" contract="COMP">
<ts:data>
<ts:address ref="ownerAddress"/>
</ts:data>
</ethereum:transaction>
</ts:transaction>
<ts:view xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<style type="text/css">&style;</style>
<script type="text/javascript">&claim.en;</script>
</ts:view>
</ts:card>

<ts:card type="action">
<ts:label>
<ts:string xml:lang="en">Delegate Vote</ts:string>
Expand Down Expand Up @@ -62,15 +84,17 @@
</ts:view>
</ts:card>
</ts:cards>
<ts:attribute name="DELEGATION_TYPEHASH">

<ts:attribute name="compAccrued">
<ts:type>
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.6</ts:syntax>
<ts:syntax>1.3.6.1.4.1.1466.115.121.1.36</ts:syntax>
</ts:type>
<ts:label>
<ts:string xml:lang="en">DELEGATION_TYPEHASH</ts:string>
<ts:string xml:lang="en">compAccrued</ts:string>
</ts:label>
<ts:origins>
<ethereum:call function="DELEGATION_TYPEHASH" contract="COMP" as="bytes"/>
<ethereum:call function="compAccrued" contract="Comptroller" as="uint"/>
</ts:origins>
</ts:attribute>

</ts:token>
Loading