Proto/CLST: deposit tez
What
Adds the FA2 ledger for single asset in the storage, which is minted from transfers
Why
How
-
TODO:
-
Fix existing generic tests, or -
Replace them with more specific tests -
Adds some combinator functions to build entrypoints
-
Change the type of CLST storage to be only a ledger for now, and no parameter.
-
Add the implementation of the contract: an entrypoint
depositaccepting tez andUnitas parameter. When it receives some tez, allocates the same amount of tokens in its storage to the sender.
Manually testing the MR
Run a sandbox, then:
octez-client --wait none transfer 100 from bootstrap1 to KT1WCsbJx996ebZfutAitHYsZ8FUZFsTdaD7 --entrypoint "deposit" --burn-cap 10
You should see in the receipt that a new bigmap entry has been created, associating 100000000 "clst" (mutez) to bootstrap1 (byte encoding of its address).
Updated big_maps:
New map(4) of type (big_map address nat)
Set map(4)[0x000002298c03ed7d454a101eb7022bc95f7e5f41ac78] to 100000000
Bake, retransfer the same amount again, and now it should be 200000000.
Voilà, you now have a contract that receives tez and handle them in a ledger.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR