The Archetype contract defines two assets: card_pattern which holds the number of cards in stock and card which hods its owner and its pattern.
We note that the concept of asset collection makes the code very straightforward compared to lower-level code: for example, the transfer_single entry point sets the card_owner field of the card with id card_to_transfer.
where sellcount is the number of times a card has been sold. Note that sellcount is not computed in the original contract. It is defined in Archetype as a shadow field (see “Asset shadow field” section below).
This property makes the contract’s business model explicit: each time a card is sold, the contract earns the value of the card’s coefficient; when every card has been sold (∀c,quantity(c)=0), the following relation stands:
We see that a high-level non-trivial property is a very powerful way to convey information about the contract.