Skip to content

Commit 6655ff2

Browse files
committed
Fix small typos
1 parent d7c329d commit 6655ff2

File tree

1 file changed

+47
-36
lines changed

1 file changed

+47
-36
lines changed

source/CIS/cis-5.rst

+47-36
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ CIS-5: Smart Contract Wallet Standard (Chaperone Account)
2222
Abstract
2323
========
2424

25-
A standard interface for defining a smart contract wallet that can hold and transfer native currency and cis2 tokens.
26-
Native currency/Cis2 tokens can be deposited into the smart contract wallet by
25+
A standard interface for defining a smart contract wallet that can hold and transfer native currency and CIS-2 tokens.
26+
Native currency/CIS-2 tokens can be deposited into the smart contract wallet by
2727
specifying to which public key the deposit should be assigned.
2828

2929
The holder of the corresponding private key is the only entity that can authorize
3030
to transfer tokens/currency in a self-custodial manner
3131
from the public key balance (assigned in the smart contract) to some new accounts/smart contracts/public keys.
3232

3333
The holder of the corresponding private key does not have to submit transactions
34-
on chain to transfer its native currency/cis2 token balance,
34+
on chain to transfer its native currency/CIS-2 token balance,
3535
but instead, it can generate a valid signature, identify a willing third
3636
party to submit its signature on-chain (a service fee can be added to financially incentivize a third party to do so).
3737

@@ -44,7 +44,7 @@ The three main actions in the smart contract that can be taken:
4444
- *withdraw*: withdraws the balance out of the smart contract wallet to a native account or smart contract.
4545

4646
The goal of this standard is to simplify the account creation onboarding flow on Concordium
47-
allowing for CIS5 smart contract wallets to be supported as first-class citizens in Concordium wallets and tooling.
47+
allowing for CIS-5 smart contract wallets to be supported as first-class citizens in Concordium wallets and tooling.
4848

4949
Specification
5050
=============
@@ -73,7 +73,7 @@ A token ID is serialized as 1 byte for the size (``n``) of the identifier, follo
7373

7474
Token IDs (as defined in the CIS-2 standard) can be as small as a single byte (by setting the first byte to the value 0)
7575
or as big as 256 bytes.
76-
The token ID in the CIS5 standard needs to be able to encode up to 256 bytes long Token IDs as a result.
76+
The token ID in the CIS-5 standard needs to be able to encode up to 256 bytes long Token IDs as a result.
7777

7878
.. _CIS-5-TokenAmount:
7979

@@ -82,7 +82,7 @@ A token ID is serialized as 1 byte for the size (``n``) of the identifier, follo
8282

8383
- The token amount SHALL be able to encode all possible tokenAmounts from the ``CIS-2 TokenAmount standard`` (:ref:`CIS-2-TokenAmount`). An amount of a token type is an unsigned integer up to 2^256 - 1.
8484

85-
It is serialized using the LEB128_ variable-length unsigned integer encoding, with the additional constraint of the total number of bytes of the encoding MUST not exceed 37 bytes::
85+
It is serialized using the LEB128_ variable-length unsigned integer encoding, with the additional constraint that the total number of bytes of the encoding MUST not exceed 37 bytes::
8686

8787
TokenAmount ::= (x: Byte) => x if x < 2^7
8888
| (x: Byte) (m: TokenAmount) => (x - 2^7) + 2^7 * m if x >= 2^7
@@ -119,7 +119,7 @@ It is serialized as: First 8 bytes for the index (``index``) followed by 8 bytes
119119

120120
Is either an :ref:`CIS-5-AccountAddress` or a :ref:`CIS-5-ContractAddress`.
121121

122-
It is serialized as: First byte indicates whether it is an account address or a contract address.
122+
It is serialized as: The first byte indicates whether it is an account address or a contract address.
123123
In case the first byte is 0 then an :ref:`CIS-5-AccountAddress` (``address``) follows.
124124
In case the first byte is 1 then a :ref:`CIS-5-ContractAddress` (``address``) follows::
125125

@@ -201,9 +201,20 @@ It is serialized as 64 bytes::
201201

202202
Signing data contains metadata for the signature that is used to check whether the signed message is designated for the correct contract and entrypoint, and that it is not expired.
203203

204-
It is serialized as :ref:`CIS-5-ContractAddress` (``contract_address``), :ref:`CIS-5-EntrypointName` (``entrypoint``), :ref:`CIS-5-Nonce` (``nonce``), and :ref:`CIS-5-Timestamp` (``timestamp``)::
204+
It is serialized as :ref:`CIS-5-ContractAddress` (``contract_address``), :ref:`CIS-5-EntrypointName` (``entrypoint``), :ref:`CIS-5-Nonce` (``nonce``), :ref:`CIS-5-Timestamp` (``timestamp``), :ref:`CIS-5-CCDAmount`/:ref:`CIS-5-TokenAmount` (``serviceFee``), and :ref:`CIS-5-Address` (``serviceFeeRecipient``)::
205+
206+
SigningData ::= (contract_address: ContractAddress) (entrypoint: EntrypointName) (nonce: Nonce) (timestamp: Timestamp) (serviceFee: CCDAmount/tokenAmount) (serviceFeeRecipient: Address)
207+
208+
For each of the signature checking endpoints the signing data is as follows::
209+
210+
WithdrawNativeCurrencySigningData ::= (to: Receiver) (ccdAmount: CCDAmount) (data: AdditionalData) (signingData: SigningData)
211+
212+
WithdrawCis2TokensSigningData ::= (to: Receiver) (tokenAmount: tokenAmount) (tokenId: tokenID) (cis2TokenContractAddress: ContractAddress) (data: AdditionalData) (signingData: SigningData)
213+
214+
InternalNativeCurrencyTransferSigningData ::= (from: PublicKeyEd25519) (to: PublicKeyEd25519) (ccdAmount: CCDAmount) (signingData: SigningData)
215+
216+
InternalCis2TokensTransferSigningData ::= (from: PublicKeyEd25519) (to: PublicKeyEd25519) (tokenAmount: tokenAmount) (tokenID: TokenID) (cis2TokenContractAddress: ContractAddress) (signingData: SigningData)
205217

206-
SigningData ::= (contract_address: ContractAddress) (entrypoint: EntrypointName) (nonce: Nonce) (timestamp: Timestamp)
207218

208219
Logged events
209220
-------------
@@ -223,7 +234,7 @@ The ``NonceEvent`` is serialized as: First a byte with the value of 250, followe
223234
``DepositNativeCurrencyEvent``
224235
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
225236

226-
A ``DepositNativeCurrencyEvent`` SHALL be logged for every `depositNativeCurrency` function invoke.
237+
A ``DepositNativeCurrencyEvent`` SHALL be logged for every ``depositNativeCurrency`` function invoke.
227238

228239
The ``DepositNativeCurrencyEvent`` is serialized as: First a byte with the value of 249, followed by the :ref:`CIS-5-CCDAmount` (``ccdAmount``), the :ref:`CIS-5-Address` (``from``), and a :ref:`CIS-5-PublicKeyEd25519` (``to``)::
229240

@@ -232,18 +243,18 @@ The ``DepositNativeCurrencyEvent`` is serialized as: First a byte with the value
232243
``DepositCis2TokensEvent``
233244
^^^^^^^^^^^^^^^^^^^^^^^^^^
234245

235-
A ``DepositCis2TokensEvent`` SHALL be logged for every `depositCis2Tokens` function invoke.
246+
A ``DepositCis2TokensEvent`` SHALL be logged for every ``depositCis2Tokens`` function invoke.
236247

237248
The ``DepositCis2TokensEvent`` is serialized as: First a byte with the value of 248, followed by the
238249
:ref:`CIS-5-TokenAmount` (``tokenAmount``), :ref:`CIS-5-TokenID` (``TokenID``),
239-
:ref:`CIS-5-ContractAddress` (``contractAddress``), the :ref:`CIS-5-Address` (``from``), and a :ref:`CIS-5-PublicKeyEd25519` (``to``)::
250+
:ref:`CIS-5-ContractAddress` (``cis2TokenContractAddress``), the :ref:`CIS-5-Address` (``from``), and a :ref:`CIS-5-PublicKeyEd25519` (``to``)::
240251

241-
DepositCis2TokensEvent ::= (248: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (contractAddress: ContractAddress) (from: Address) (to: PublicKeyEd25519)
252+
DepositCis2TokensEvent ::= (248: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (cis2TokenContractAddress: ContractAddress) (from: Address) (to: PublicKeyEd25519)
242253

243254
``WithdrawNativeCurrencyEvent``
244255
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
245256

246-
A ``WithdrawNativeCurrencyEvent`` SHALL be logged for every `withdrawNativeCurrency` function invoke.
257+
A ``WithdrawNativeCurrencyEvent`` SHALL be logged for every ``withdrawNativeCurrency`` function invoke.
247258

248259
The ``WithdrawNativeCurrencyEvent`` is serialized as: First a byte with the value of 247, followed by the :ref:`CIS-5-CCDAmount` (``ccdAmount``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-Address` (``to``)::
249260

@@ -252,18 +263,18 @@ The ``WithdrawNativeCurrencyEvent`` is serialized as: First a byte with the valu
252263
``WithdrawCis2TokensEvent``
253264
^^^^^^^^^^^^^^^^^^^^^^^^^^^
254265

255-
A ``WithdrawCis2TokensEvent`` SHALL be logged for every `withdrawCis2Tokens` function invoke.
266+
A ``WithdrawCis2TokensEvent`` SHALL be logged for every ``withdrawCis2Tokens`` function invoke.
256267

257268
The ``WithdrawCis2TokensEvent`` is serialized as: First a byte with the value of 246, followed by the
258269
:ref:`CIS-5-TokenAmount` (``tokenAmount``), :ref:`CIS-5-TokenID` (``TokenID``),
259-
:ref:`CIS-5-ContractAddress` (``contractAddress``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-Address` (``to``)::
270+
:ref:`CIS-5-ContractAddress` (``cis2TokenContractAddress``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-Address` (``to``)::
260271

261-
WithdrawCis2TokensEvent ::= (246: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (contractAddress: ContractAddress) (from: PublicKeyEd25519) (to: Address)
272+
WithdrawCis2TokensEvent ::= (246: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (cis2TokenContractAddress: ContractAddress) (from: PublicKeyEd25519) (to: Address)
262273

263274
``InternalNativeCurrencyTransferEvent``
264275
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
265276

266-
A ``InternalNativeCurrencyTransferEvent`` SHALL be logged for every `internalNativeCurrencyTransfer` function invoke.
277+
A ``InternalNativeCurrencyTransferEvent`` SHALL be logged for every ``internalNativeCurrencyTransfer`` function invoke.
267278

268279
The ``InternalNativeCurrencyTransferEvent`` is serialized as: First a byte with the value of 245, followed by the :ref:`CIS-5-CCDAmount` (``ccdAmount``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-PublicKeyEd25519` (``to``)::
269280

@@ -272,13 +283,13 @@ The ``InternalNativeCurrencyTransferEvent`` is serialized as: First a byte with
272283
``InternalCis2TokensTransferEvent``
273284
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274285

275-
A ``InternalCis2TokensTransferEvent`` SHALL be logged for every `internalCis2TokensTransfer` function invoke.
286+
A ``InternalCis2TokensTransferEvent`` SHALL be logged for every ``internalCis2TokensTransfer`` function invoke.
276287

277288
The ``InternalCis2TokensTransferEvent`` is serialized as: First a byte with the value of 244, followed by the
278289
:ref:`CIS-5-TokenAmount` (``tokenAmount``), :ref:`CIS-5-TokenID` (``TokenID``),
279-
:ref:`CIS-5-ContractAddress` (``contractAddress``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-PublicKeyEd25519` (``to``)::
290+
:ref:`CIS-5-ContractAddress` (``cis2TokenContractAddress``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and the :ref:`CIS-5-PublicKeyEd25519` (``to``)::
280291

281-
InternalCis2TokensTransferEvent ::= (244: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (contractAddress: ContractAddress) (from: PublicKeyEd25519) (to: PublicKeyEd25519)
292+
InternalCis2TokensTransferEvent ::= (244: Byte) (tokenAmount: TokenAmount) (tokenId: TokenID) (cis2TokenContractAddress: ContractAddress) (from: PublicKeyEd25519) (to: PublicKeyEd25519)
282293

283294

284295

@@ -337,7 +348,7 @@ of a CIS-2 token contract. The function deposits/assigns the send CIS-2 token am
337348
The smart contract wallet is not required to check if the invoking contract is a CIS-2 token contract or has some reasonable receive hook logic implemented.
338349
If no additional authorization is added to this function, similar caution should be applied as if you would directly interact with any CIS-2 token contract.
339350
Only interact with a CIS-2 token contract or value its recorded token balance if you checked its smart
340-
contract logic or reasonable social reputation are given to the project/CIS-2 token contract.
351+
contract logic or reasonable social reputation is given to the project/CIS-2 token contract.
341352

342353
Parameter
343354
~~~~~~~~~
@@ -360,7 +371,7 @@ Requirements
360371
^^^^^^^^^^^^^^^^^^^^^^^^^^
361372

362373
The function executes a list of token withdrawals of CCDs (native currency) to native accounts and/or smart contracts out of the smart contract wallet.
363-
When transferring CCD to a contract address, a ccd receive hook function MUST be triggered.
374+
When transferring CCD to a contract address, a CCD receive hook function MUST be triggered.
364375

365376
Parameter
366377
~~~~~~~~~
@@ -382,7 +393,7 @@ the receiving address :ref:`CIS-2-Receiver` (``to``), a :ref:`CIS-5-CCDAmount` (
382393
CCD Receive hook parameter
383394
~~~~~~~~~~~~~~~~~~~~~~~~~~
384395

385-
The parameter for the ccd receive hook function contains information about the transfer and some additional data bytes.
396+
The parameter for the CCD receive hook function contains information about the transfer and some additional data bytes.
386397

387398
It is serialized as: a :ref:`CIS-5-CCDAmount` (``ccdAmount``), a :ref:`CIS-5-PublicKeyEd25519` (``from``), and some aditional data :ref:`CIS-2-AdditionalData` (``data``)::
388399

@@ -396,14 +407,14 @@ Requirements
396407
- The contract function MUST reject if any of the withdrawals fail to be executed.
397408
- The function MUST emit a ``NonceEvent`` and a ``WithdrawNativeCurrencyEvent`` for every withdrawal.
398409
- The function MUST reject if the signature verification fails for any withdrawal.
399-
- The function MUST fail, if the CCD balance of the ``signer`` is insufficient to do the withdrawal for any withdrawal.
410+
- The function MUST fail if the CCD balance of the ``signer`` is insufficient to do the withdrawal for any withdrawal.
400411
- A function MUST non-strictly decrease the CCD balance of the ``signer`` public key and non-strictly increase the balance of the ``to`` address or fail for any withdrawal.
401412
- A withdrawal back to this contract into the ``depositNativeCurrency`` entrypoint MUST be executed as a normal withdrawal.
402413
- A withdrawal of a CCD amount of zero MUST be executed as a normal withdrawal.
403-
- A withdrawal of any amount of CCD to a contract address MUST call a ccd receive hook function on the receiving smart contract with a :ref:`ccd receive hook parameter<CIS-5-functions-transfer-ccd-receive-hook-parameter>`.
404-
- The contract function MUST reject if the ccd receive hook function called on the contract receiving CCDs rejects for any withdrawal.
414+
- A withdrawal of any amount of CCD to a contract address MUST call a CCD receive hook function on the receiving smart contract with a :ref:`ccd receive hook parameter<CIS-5-functions-transfer-ccd-receive-hook-parameter>`.
415+
- The contract function MUST reject if the CCD receive hook function called on the contract receiving CCDs rejects for any withdrawal.
405416
- The balance of a public key not owning any CCD amount SHOULD be treated as having a balance of zero.
406-
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every withdrawal.
417+
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every withdrawal if ``serviceFee!=0``.
407418

408419
.. warning::
409420

@@ -442,12 +453,12 @@ Requirements
442453
- The function MUST emit a ``NonceEvent`` and a ``WithdrawCis2TokensEvent`` for every withdrawal.
443454
- The function MUST reject if the signature verification fails for any withdrawal.
444455
- This function MUST call the ``transfer`` function on the CIS-2 token contract for every withdrawal.
445-
- The function MUST fail, if the token balance of the ``signer`` is insufficient to do the withdrawal for any withdrawal.
456+
- The function MUST fail if the token balance of the ``signer`` is insufficient to do the withdrawal for any withdrawal.
446457
- A function MUST non-strictly decrease the token balance of the ``signer`` public key and non-strictly increase the balance of the ``to`` address or fail for any withdrawal.
447458
- A withdrawal back to this contract into the ``depositCis2Tokens`` entrypoint MUST be executed as a normal withdrawal.
448459
- A withdrawal of a token amount of zero MUST be executed as a normal withdrawal.
449460
- The balance of a public key not owning any tokens SHOULD be treated as having a balance of zero.
450-
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every withdrawal.
461+
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every withdrawal if ``serviceFee!=0``.
451462

452463
.. _CIS-5-functions-internalNativeCurrencyTransfer:
453464

@@ -475,11 +486,11 @@ Requirements
475486

476487
- The function MUST emit a ``NonceEvent`` and a ``InternalNativeCurrencyTransferEvent`` for every transfer.
477488
- The function MUST reject if the signature verification fails for any transfer.
478-
- The function MUST fail, if the CCD balance of the ``signer`` is insufficient to do the tranfser for any transfer.
489+
- The function MUST fail if the CCD balance of the ``signer`` is insufficient to do the transfer for any transfer.
479490
- A function MUST non-strictly decrease the CCD balance of the ``signer`` public key and non-strictly increase the balance of the ``to`` address or fail for any transfer.
480491
- A transfer of a CCD amount of zero MUST be executed as a normal transfer.
481492
- The balance of a public key not owning any CCD amount SHOULD be treated as having a balance of zero.
482-
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every transfer.
493+
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every transfer if ``serviceFee!=0``.
483494

484495
.. _CIS-5-functions-internalCis2TokensTransfer:
485496

@@ -508,11 +519,11 @@ Requirements
508519

509520
- The function MUST emit a ``NonceEvent`` and a ``InternalCis2TokensTransferEvent`` for every transfer.
510521
- The function MUST reject if the signature verification fails for any of the transfers.
511-
- The function MUST fail, if the token balance of the ``signer`` is insufficient to do the transfer for any transfer.
522+
- The function MUST fail if the token balance of the ``signer`` is insufficient to do the transfer for any transfer.
512523
- A function MUST non-strictly decrease the token balance of the ``signer`` public key and non-strictly increase the balance of the ``to`` address or fail for any transfer.
513524
- A transfer of a token amount of zero MUST be executed as a normal transfer.
514525
- The balance of a public key not owning any tokens SHOULD be treated as having a balance of zero.
515-
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every transfer.
526+
- The function MUST transfer the ``serviceFee`` to the ``serviceFeeRecipient`` for every transfer if ``serviceFee!=0``.
516527

517528
.. _CIS-5-functions-balanceOfNativeCurrency:
518529

@@ -524,7 +535,7 @@ The function queries the CCD balances of a list of public keys.
524535
Parameter
525536
~~~~~~~~~
526537

527-
The parameter consists of a list public keys.
538+
The parameter consists of a list of public keys.
528539

529540
It is serialized as: 2 bytes for the number of queries (``n``) and then this number of queries (``queries``).
530541
A query is serialized as a :ref:`CIS-5-PublicKeyEd25519` (``publicKey``)::
@@ -582,7 +593,7 @@ It is serialized as: 2 bytes for the number of token amounts (``n``) and then th
582593
Requirements
583594
~~~~~~~~~~~~
584595

585-
- The balance of an public key not owning any amount of a token type SHOULD be treated as having a balance of zero.
596+
- The balance of a public key not owning any amount of a token type SHOULD be treated as having a balance of zero.
586597
- The number of results in the response MUST correspond to the number of the queries in the parameter.
587598
- The order of results in the response MUST correspond to the order of queries in the parameter.
588599
- The contract function MUST NOT increase or decrease the CCD balance or token balance of any public key for any token type.

0 commit comments

Comments
 (0)