This repository contains a series of exercises completed using SmartPy, a Python-based smart contract development platform for the Tezos blockchain.
Objective: Implement a simple counter with an increment function.
Steps:
- Write the contract in the SmartPy IDE and include a test scenario.
- Test the code in the SmartPy IDE.
- Retrieve the Michelson code and test it using octez-client.
- Deploy the contract using octez-client.
- Interact with the contract by sending a transaction to its
inc()
entry point. - Verify all operations using a block explorer.
Objective: Extend the counter contract to include a decrement function.
Steps:
- Test the Michelson code with octez-client.
- Originate the contract.
- Make multiple calls to the contract, varying the entry points.
- Verify the results obtained using octez-client or a block explorer.
Objective: Write a contract that concatenates string values to its storage, separating each string by a comma.
Steps:
- Implement the contract in the SmartPy IDE.
- Test the contract in the IDE.
- Retrieve and test the Michelson code.
- Deploy the contract using octez-client.
- Interact with the contract using a block explorer.
Objective: Modify a contract to include a pair or record type storage containing TString and TInt components.
Steps:
- Modify the contract to include the desired storage structure.
- Test the contract's functionality in the SmartPy IDE.
- Retrieve the Michelson code and test it.
- Deploy the updated contract and verify its behavior.
Objective: Write a contract with two entry points (add
and sub
) to modify its storage.
Steps:
- Implement the contract in the SmartPy IDE.
- Test each entry point's functionality.
- Retrieve the Michelson code and deploy the contract.
- Interact with the contract using different addresses and verify its behavior.
Objective: Rewrite the contract from Exercise 5 using Options.
Steps:
- Modify the contract to use Options for certain values.
- Test the modified contract in the SmartPy IDE.
- Deploy the contract and verify its behavior.
Objective: Write a contract allowing the owner to receive donations and withdraw funds.
Steps:
- Implement the contract in the SmartPy IDE.
- Write tests to verify its functionality.
- Originate the contract and test its behavior.
- Verify the contract's operation using a block explorer.
By completing these exercises, we gain practical experience in writing, testing, deploying, and interacting with smart contracts on the Tezos blockchain using SmartPy.