You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/mainnet/tutorials/sponsoredTransactions/index.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ What is the difference between a normal transaction vs. a sponsored transaction?
47
47
48
48
A normal transaction sent to a smart contract is signed by the user's wallet and authorizes the blockchain to subtract the transaction fee from the user's wallet as well as to execute a specific action. For example, the action could be to transfer some tokens from the user's address to another address.
49
49
50
-
The user creates a normal transaction by signing its ``account`` address, its ``nonce``, and the ``action``. The ``nonce`` increases sequentially every time the user sends a transaction to the blockchain to prevent replay attacks. The nonce is of type u64 (8 bytes) and by design >= 1.
50
+
The user creates a normal transaction by signing its ``account`` address, its ``nonce``, and the ``action``. The ``nonce`` increases sequentially every time the user sends a transaction to the blockchain to prevent replay attacks. The `nonce<https://en.wikipedia.org/wiki/Cryptographic_nonce>`_ is of type u64 (8 bytes) and by design >= 1.
Copy file name to clipboardExpand all lines: source/mainnet/tutorials/sponsoredTransactions/sponsoredTransactionsSmartContract.rst
+15-11Lines changed: 15 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,17 @@ The goal of this part of the tutorial is to understand how the sponsored
9
9
transaction mechanism is implemented in the smart contract and how to create and verify an Ed25519 signature in the smart contract code.
10
10
11
11
Clone the `sponsored transaction example <https://github.com/Concordium/concordium-rust-smart-contracts/tree/main/examples/cis3-nft-sponsored-txs>`_
12
-
which you will modify in this tutorial.
12
+
which you will modify in this tutorial. The ``recurse-submodules`` flag is needed because the git repository contains `submodules <https://git-scm.com/book/en/v2/Git-Tools-Submodules>`_ which need to be cloned along with the example.
The ``cis3_nft`` contract implements the `CIS-3 standard (sponsored transactions) <https://proposals.concordium.software/CIS/cis-3.html>`_. The standard defines that the contract has to expose the
25
25
``permit`` and the ``supportsPermit`` functions.
@@ -79,7 +79,9 @@ You can explore the function by invoking it with the ``concordium-client`` as fo
``6372`` is the index of the smart contract. A smart contract address consists of an index and a subindex, in the current protocol the subindex will always be 0. So, in other words, the command above means invoke contract with index 6372 on the testnet.
83
85
84
86
For example, this ``supportsPermit.json`` file results in the below screenshot.
85
87
@@ -120,9 +122,9 @@ Run the test cases to confirm that they pass before you start modifying the code
120
122
121
123
.. code-block:: console
122
124
123
-
$cargo test
125
+
$cargo test
124
126
or
125
-
$cargo concordium test
127
+
$cargo concordium test
126
128
127
129
.. image:: ./images/testCases.png
128
130
:alt:Running the test cases
@@ -146,7 +148,9 @@ This prints the ``message_hash`` when running the test cases as follows:
146
148
147
149
.. code-block:: console
148
150
149
-
$cargo test -- --nocapture
151
+
$ cargo test -- --nocapture
152
+
153
+
To learn more about the ``nocapture`` flag you can follow `this link <https://doc.rust-lang.org/cargo/commands/cargo-test.html#display-options>`_
150
154
151
155
.. image:: ./images/messageHash.png
152
156
:alt:Printing the message hash
@@ -184,13 +188,13 @@ Add the above code snippet to the top of a test case and run the test cases agai
You can create the below signature constant. This signature can be used in test cases to check if your signature verification logic in the smart contract works.
196
200
@@ -209,13 +213,13 @@ Add the above code snippet to the top of a test case and run the test cases agai
You can create the below public key constant. This public key can be used in test cases to check if your signature verification logic in the smart contract works.
0 commit comments