/try-archetype

Primary LanguageDockerfileMIT LicenseMIT

GitHub-Mark-Light GitHub-Mark-Light

Welcome to the Archetype Gitpod environement. It comes with the following installed packages:

You can develop, deploy, call and test a smart contract on the Tezos blockchain.

Your journey starts here!

First, check whether the test account has enough balance to run the tutorial; entrer this command in the Terminal below:

completium-cli show account

It displays the balance of the account named 'admin'.

If this balance is below 50 ꜩ, then follow these instructions to import a new account (or transfer 100 ꜩ to the admin address on testnet).

Then start the tutorial with Hello Tezos world.arl: fix the code, deploy the contract, and call it.

Then continue with tutorial's step 2 below.

Archetype tutorial

The tutorial directory provides 8 basic exercises to discover Archetype:

File Description
1 Hello Tezos world Write and deploy your first contract
2 Execution conditions Syntax to establish business rules to execute an entry point
3 Rational and transfer Use rational type for business formula
4 Date and duration Use duration to establish time based execution conditions
5 Dates arithmetic Compute day of the week from date
6 State machine Improve your contract's design with state machines
7 Assets Benefit from rich storage API
8 Call a contract Learn how to retreive data from a called contract

Completium CLI

Completium CLI is a command line on top of Archetype and Tezos client to interact with Archetype contracts.

You can use completium in VS Code in the Terminal (Menu Terminal/New Terminal).

The Gipod environment comes with an account already registered, named admin at address tz1MZrh8CvYkp7BfLQMcm6mg5FvL5HRZfACw

Show registered accounts

$ completium-cli show account

You may want to register your own test account with a faucet file:

$ completium-cli generate account <ACCOUNT_NAME> --from-faucet <FAUCET_FILE>

It is strongly advised to develop and test on the test network. Check you are interacting with the test network with:

$ completium-cli show endpoint

Switch endpoint:

$ completium-cli switch endpoint

Deploy a contract:

$ completium-cli deploy <FILE.arl>

The entire list of commands is available here.

Archetype VS Code extension

Archetype VS Code extension provides the following VS code commands (ctrl/md + P):

Command Description
1 Archetype: Generate Michelson Compiles to Michelson and displays code in new tab.
2 Archetype: Generate Whyml Transcodes contract to Why3 language and displays in new tab.
3 Archetype: Generate Markdown Generates markdown for documentation and displays in new tab.

Other commands are available.

Completium DApps

Click here to learn how to developp DApps with 9 real examples spanning various domains and real life situations: DEX, DeFi, NFT, Gaming, Governance, ...

DApp Description
1 Fidelity program Customers of a service (transport, gaming, grocery, ...) receive miles and trade them in for gifts, cash-back, or any kind of reward.
2 Connected object Switch on for a certain duration or interrupt an online bulb connected to a Tezos smart contract, by transferring fund to this smart contract.
3 Idea box An online retail company provides an ideabox for customers and/or employees to post ideas to improve customer experience.
4 2048 Competition Win the competition of the famous 2048 game by sliding numbered tiles that pops up at random position on the grid and obtain the highest score.
5 Online payment An online retailer provides a decentralized process to transfer payment from buyer to seller without the need for a third party.
6 Collectible cards The cryptobot company is issuing a hundred collectible robot cards. Build your optimal card deck by buying and selling them online!
7 DEX A Decentralized Exchange (DEX) enbable customers to trade cryptocurrencies without the need for an intermediary.
8 Zero-Coupon bond Use your company’s online DeFi solution to deploy a templated Zero Coupon bond contract on the Tezos blockchain for your customers.
9 Auction Participate in an blockchain-powered online auction of exceptional rare paintings and don’t forget to overbid! (coming soon ...)

Smart Contracts base

The contracts directory (on the left hand side panel) provides 30+ contracts to start with either to learn the Archetype language or to bootstrap your project from.

DeFI

File Description
1 autocallable.arl Adaptation to Archetpye of an autocallable bond by Goldman Sach. Information here.
2 bond.arl Archetype version of the contract taken from the Findel paper (Financial Derivatives Language).
3 erc20.arl Archetype implementation of Ethereum's ERC20 (fungible token) specification.
4 fa12.arl Archetype implementation of Tezos specification for fungible token.
5 fa12_inspector.arl Token inspector for FA 1.2 specification
6 fa2.arl Archetype implementation of Tezos specification for NFT (FA 2)
7 escrow_basic.arl Basic escrow process.
8 escrow_penalty.arl Escrow presented with a penalty for the seller if the transaction fails (for example if it does not happen before the deadline)
9 escrow_simple.arl
10 escrow_without_spec.arl
11 zero_coupon_bond.arl
12 zero_coupon_bond_with_insurance.arl
13 ico.arl Archetype version of the BCDiploma ICO

Governance

File Description
1 auction.arl
2 auction_lazy.arl
3 auction_no_memory.arl This is the most basic version of an auction process. It does not memorise who bid what ...
4 auction_zilliqa.arl Archetype version of Zilliqa's auction example
5 c3n.arl Archetype version of the C3N contract. The Michelson version is deployed on the Tezos mainnet.
6 certification_token.arl The Dapp proposes a “token” linked to lifelong learning effort
7 certificate_generator.arl Dapp's token
8 competition.arl
9 voting_process.arl
10 register_candidate.arl
11 register_vote.arl
12 ideasbox.arl
13 mini_dao.arl
14 unanimity.arl
15 coase.arl Archetype version of the Coase contract

Insurance

File Description
1 fizzy.arl
2 guarantee_fund.arl
3 health_care.arl

Marketing

File Description
1 miles.arl
2 miles_with_expiration.arl
3 miles_with_expiration_simple.arl
4 mwe_fit.arl
5 mwe_medium.arl

Other plateforms examples

File Description
1 animal_tracking.arl Archetype version of the Hyperledger Animal tracking example
2 perishable.arl Archetype version of the Hyperledger Perishable example
3 vehicle_lifecycle.arl Archetype version of the Hyperledger Vehicle lifecycle example
4 clause_io_acceptance_of_delivery.arl

Misc.

File Description
1 empty.arl
2 hello.arl
3 oraclesetvalue.arl
4 sig_challenge.arl