Skip to content

Commit

Permalink
Update: Transfer content.
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanIngte authored and BryanIngte committed Dec 30, 2023
1 parent 566fcb8 commit 5d310d5
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 36 deletions.
2 changes: 1 addition & 1 deletion book/Introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h1 class="menu-title">SNRC-20: Starknet Inscription Standard</h1>
<div id="content" class="content">
<main>
<h1 id="what-is-snrc-20"><a class="header" href="#what-is-snrc-20">What is SNRC-20?</a></h1>
<p><img src="https://stark-scription.vercel.app/assets/stark_hero-wMjrhaZw.png" alt="" /></p>
<p><img src="https://images2.imgbox.com/65/6f/s2fphZpp_o.png" alt="" /></p>
<p><code>SNRC-20</code> is an inscription standard based on Starknet, developed by developers from the Starknet community worldwide as a public good, capable of off-chain computation and verification.</p>
<p><code>SNRC-20</code> not only includes standards for the inscription, but also provides integration interfaces for SNRC-20-compatible smart contracts and suggestions for implementing indexers. </p>
<p><code>SNRC-20</code> strives to ensure fairness, transparency, and efficiency in all processes.</p>
Expand Down
17 changes: 7 additions & 10 deletions book/Transfer_Interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,33 +170,30 @@ <h1 id="transfer-function-interface"><a class="header" href="#transfer-function-
<p>The Transfer Interface defines a function interface that can execute a <a href="Transfer_OP.html">Transfer operation</a>.</p>
<h2 id="input"><a class="header" href="#input">Input</a></h2>
<p>There are no strict requirements for the input, but it is recommended to use the input format defined in the <a href="Transfer_OP.html">Transfer operation</a>.</p>
<p>You can also write a function that only takes the <code>tick</code>, <code>amt</code> and <code>recipient</code> parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.</p>
<p>You can also write a function that only takes the <code>tick</code>, <code>amt</code> parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.</p>
<h2 id="output"><a class="header" href="#output">Output</a></h2>
<p>The output of this function should be a message payload, which conform to the following format:</p>
<div class="table-wrapper"><table><thead><tr><th>Paramter</th><th>type</th><th>Description</th></tr></thead><tbody>
<tr><td>Transfer_hash</td><td>Felt252</td><td>Hash of Transfer operation</td></tr>
<tr><td>Recipient</td><td>ContractAddress</td><td>Recipient's address</td></tr>
<tr><td>Amount</td><td>Felt252(u128)</td><td>Amount of this transfer operation</td></tr>
<tr><td>Amount</td><td>Felt252(u128)</td><td>Amount of this Transfer operation</td></tr>
</tbody></table>
</div>
<p>These data contain the key elements to restore the complete <code>Transfer</code> inscription.</p>
<p>Here is an example of an message payload(in Hex):</p>
<div class="table-wrapper"><table><thead><tr><th>Index</th><th>Value</th></tr></thead><tbody>
<tr><td>0</td><td>0x67c8925ab87c1501277c28168c59fbb93e434fd75c9133e455b866fd7efea5d</td></tr>
<tr><td>1</td><td>0x0</td></tr>
<tr><td>2</td><td>0x22658</td></tr>
<tr><td>0</td><td>0x59b6615aedfdd1bd23b762b51485eae4c5ee84189c21c2b59822fea62518eb5</td></tr>
<tr><td>1</td><td>0x22658</td></tr>
</tbody></table>
</div>
<h2 id="event"><a class="header" href="#event">Event</a></h2>
<p>After a Transfer function is successfully executed, it should emit an event. This will facilitate the indexer to include this transaction.</p>
<p>The format of the events is as follows:</p>
<p><code>event Trasfer(sender, hash, recipient, amount)</code></p>
<p><code>event Transfer(sender, hash, amount)</code></p>
<p>The parameters are:</p>
<div class="table-wrapper"><table><thead><tr><th>Input</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>sender</td><td>ContractAddress</td><td>Sender's address</td></tr>
<tr><td>hash</td><td>Felt252</td><td>Mint_hash</td></tr>
<tr><td>recipient</td><td>ContractAddress</td><td>Recipient's address</td></tr>
<tr><td>amount</td><td>Felt252(u128)</td><td>Amount of this mint operation</td></tr>
<tr><td>hash</td><td>Felt252</td><td>Transfer_hash</td></tr>
<tr><td>amount</td><td>Felt252(u128)</td><td>Amount of this Transfer operation</td></tr>
</tbody></table>
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion book/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h1 class="menu-title">SNRC-20: Starknet Inscription Standard</h1>
<div id="content" class="content">
<main>
<h1 id="what-is-snrc-20"><a class="header" href="#what-is-snrc-20">What is SNRC-20?</a></h1>
<p><img src="https://stark-scription.vercel.app/assets/stark_hero-wMjrhaZw.png" alt="" /></p>
<p><img src="https://images2.imgbox.com/65/6f/s2fphZpp_o.png" alt="" /></p>
<p><code>SNRC-20</code> is an inscription standard based on Starknet, developed by developers from the Starknet community worldwide as a public good, capable of off-chain computation and verification.</p>
<p><code>SNRC-20</code> not only includes standards for the inscription, but also provides integration interfaces for SNRC-20-compatible smart contracts and suggestions for implementing indexers. </p>
<p><code>SNRC-20</code> strives to ensure fairness, transparency, and efficiency in all processes.</p>
Expand Down
19 changes: 8 additions & 11 deletions book/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ <h1 class="menu-title">SNRC-20: Starknet Inscription Standard</h1>
<div id="content" class="content">
<main>
<h1 id="what-is-snrc-20"><a class="header" href="#what-is-snrc-20">What is SNRC-20?</a></h1>
<p><img src="https://stark-scription.vercel.app/assets/stark_hero-wMjrhaZw.png" alt="" /></p>
<p><img src="https://images2.imgbox.com/65/6f/s2fphZpp_o.png" alt="" /></p>
<p><code>SNRC-20</code> is an inscription standard based on Starknet, developed by developers from the Starknet community worldwide as a public good, capable of off-chain computation and verification.</p>
<p><code>SNRC-20</code> not only includes standards for the inscription, but also provides integration interfaces for SNRC-20-compatible smart contracts and suggestions for implementing indexers. </p>
<p><code>SNRC-20</code> strives to ensure fairness, transparency, and efficiency in all processes.</p>
Expand Down Expand Up @@ -659,33 +659,30 @@ <h2 id="event-1"><a class="header" href="#event-1">Event</a></h2>
<p>The Transfer Interface defines a function interface that can execute a <a href="Transfer_OP.html">Transfer operation</a>.</p>
<h2 id="input-2"><a class="header" href="#input-2">Input</a></h2>
<p>There are no strict requirements for the input, but it is recommended to use the input format defined in the <a href="Transfer_OP.html">Transfer operation</a>.</p>
<p>You can also write a function that only takes the <code>tick</code>, <code>amt</code> and <code>recipient</code> parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.</p>
<p>You can also write a function that only takes the <code>tick</code>, <code>amt</code> parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.</p>
<h2 id="output-2"><a class="header" href="#output-2">Output</a></h2>
<p>The output of this function should be a message payload, which conform to the following format:</p>
<div class="table-wrapper"><table><thead><tr><th>Paramter</th><th>type</th><th>Description</th></tr></thead><tbody>
<tr><td>Transfer_hash</td><td>Felt252</td><td>Hash of Transfer operation</td></tr>
<tr><td>Recipient</td><td>ContractAddress</td><td>Recipient's address</td></tr>
<tr><td>Amount</td><td>Felt252(u128)</td><td>Amount of this transfer operation</td></tr>
<tr><td>Amount</td><td>Felt252(u128)</td><td>Amount of this Transfer operation</td></tr>
</tbody></table>
</div>
<p>These data contain the key elements to restore the complete <code>Transfer</code> inscription.</p>
<p>Here is an example of an message payload(in Hex):</p>
<div class="table-wrapper"><table><thead><tr><th>Index</th><th>Value</th></tr></thead><tbody>
<tr><td>0</td><td>0x67c8925ab87c1501277c28168c59fbb93e434fd75c9133e455b866fd7efea5d</td></tr>
<tr><td>1</td><td>0x0</td></tr>
<tr><td>2</td><td>0x22658</td></tr>
<tr><td>0</td><td>0x59b6615aedfdd1bd23b762b51485eae4c5ee84189c21c2b59822fea62518eb5</td></tr>
<tr><td>1</td><td>0x22658</td></tr>
</tbody></table>
</div>
<h2 id="event-2"><a class="header" href="#event-2">Event</a></h2>
<p>After a Transfer function is successfully executed, it should emit an event. This will facilitate the indexer to include this transaction.</p>
<p>The format of the events is as follows:</p>
<p><code>event Trasfer(sender, hash, recipient, amount)</code></p>
<p><code>event Transfer(sender, hash, amount)</code></p>
<p>The parameters are:</p>
<div class="table-wrapper"><table><thead><tr><th>Input</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>sender</td><td>ContractAddress</td><td>Sender's address</td></tr>
<tr><td>hash</td><td>Felt252</td><td>Mint_hash</td></tr>
<tr><td>recipient</td><td>ContractAddress</td><td>Recipient's address</td></tr>
<tr><td>amount</td><td>Felt252(u128)</td><td>Amount of this mint operation</td></tr>
<tr><td>hash</td><td>Felt252</td><td>Transfer_hash</td></tr>
<tr><td>amount</td><td>Felt252(u128)</td><td>Amount of this Transfer operation</td></tr>
</tbody></table>
</div><div style="break-before: page; page-break-before: always;"></div><h1 id="indexer"><a class="header" href="#indexer">Indexer</a></h1>
<p>Since inscriptions do not adopt the account balance mechanism by default (reminder: you can still combine it with the account balance mechanism, this is not mandatory), you need an indexer to record user balances.</p>
Expand Down
2 changes: 1 addition & 1 deletion book/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion book/searchindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What is SNRC-20?

![](https://stark-scription.vercel.app/assets/stark_hero-wMjrhaZw.png)
![](https://images2.imgbox.com/65/6f/s2fphZpp_o.png)

`SNRC-20` is an inscription standard based on Starknet, developed by developers from the Starknet community worldwide as a public good, capable of off-chain computation and verification.

Expand Down
17 changes: 7 additions & 10 deletions src/Transfer_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,36 @@ The Transfer Interface defines a function interface that can execute a [Transfer

There are no strict requirements for the input, but it is recommended to use the input format defined in the [Transfer operation](Transfer_OP.md).

You can also write a function that only takes the `tick`, `amt` and `recipient` parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.
You can also write a function that only takes the `tick`, `amt` parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.

## Output
The output of this function should be a message payload, which conform to the following format:

| Paramter | type | Description |
| ---- | ---- | ---- |
| Transfer_hash | Felt252 | Hash of Transfer operation |
| Recipient | ContractAddress | Recipient's address |
| Amount | Felt252(u128) | Amount of this transfer operation |
| Amount | Felt252(u128) | Amount of this Transfer operation |

These data contain the key elements to restore the complete `Transfer` inscription.

Here is an example of an message payload(in Hex):

| Index | Value |
| ---- | ---- |
| 0 | 0x67c8925ab87c1501277c28168c59fbb93e434fd75c9133e455b866fd7efea5d |
| 1 | 0x0 |
| 2 | 0x22658 |
| 0 | 0x59b6615aedfdd1bd23b762b51485eae4c5ee84189c21c2b59822fea62518eb5 |
| 1 | 0x22658 |

## Event
After a Transfer function is successfully executed, it should emit an event. This will facilitate the indexer to include this transaction.

The format of the events is as follows:

`event Trasfer(sender, hash, recipient, amount)`
`event Transfer(sender, hash, amount)`

The parameters are:

| Input | Type | Description |
| ---- | ---- | ---- |
| sender | ContractAddress | Sender's address |
| hash | Felt252 | Mint_hash |
| recipient | ContractAddress | Recipient's address |
| amount | Felt252(u128) | Amount of this mint operation |
| hash | Felt252 | Transfer_hash |
| amount | Felt252(u128) | Amount of this Transfer operation |

0 comments on commit 5d310d5

Please sign in to comment.