plutus-pioneer-program/README.md

100 lines
5.7 KiB
Markdown
Raw Normal View History

2021-04-08 12:07:47 +02:00
# Plutus Pioneer Program
## Lectures
2021-06-29 20:19:13 +02:00
- [Lecture #1](https://youtu.be/_zr3W8cgzIQ)
2021-04-08 12:07:47 +02:00
2021-06-29 20:35:55 +02:00
- Welcome.
- The (E)UTxO-model.
- Building the example code.
- An auction contract in the EUTxO-model.
- A brief look at the auction code.
- Running an example auction contract on a local Playground.
- Homework.
2021-04-13 12:48:07 +02:00
2021-07-07 23:34:11 +02:00
- [Lecture #2](https://youtu.be/sN3BIa3GAOc)
2021-07-07 23:29:58 +02:00
- Triggering change.
- Low-level, untyped on-chain validation scripts.
- High-level, typed on-chain validation scripts.
2021-07-14 21:06:45 +02:00
- [Lecture #3](https://youtu.be/6_rfCCY9_gY)
- Script contexts.
- Time handling.
- Parameterized contracts.
2021-07-21 13:14:27 +02:00
- [Lecture #4](https://youtu.be/g4lvA14I-Jg)
- Monads.
- The `EmulatorTrace`-monad.
- The `Contract`-monad.
2021-04-08 12:07:47 +02:00
## Code Examples
2021-06-10 10:32:29 +02:00
- Lecture #1: [English Auction](code/week01)
2021-07-07 23:29:58 +02:00
- Lecture #2: [Simple validation](code/week02)
2021-07-15 20:20:50 +02:00
- Lecture #3: [Script Context & Parameterized Contracts](code/week03)
2021-07-21 13:14:27 +02:00
- Lecture #4: [Monad, Traces & Contracts](code/week04)
2021-04-08 12:07:47 +02:00
2021-04-08 12:15:17 +02:00
## Exercises
- Week #1
- Clone the [The Plutus repository](https://github.com/input-output-hk/plutus), check out the correct commit
as specified in [cabal.project](code/week01/cabal.project).
- Install NixOS cross-referencing the following resources.
- https://nixos.org/download.html
- https://docs.plutus-community.com
- A few resources to understand the what and why regarding NixOS
- https://nixos.org/manual/nix/stable
- https://serokell.io/blog/what-is-nix
2021-04-09 09:36:15 +02:00
- Set-up IOHK binary caches [How to set up the IOHK binary caches](https://github.com/input-output-hk/plutus#iohk-binary-cache). "If you do not do this, you will end up building GHC, which takes several hours. If you find yourself building GHC, STOP and fix the cache."
2021-04-08 12:15:17 +02:00
- Enter a `nix-shell`.
2021-06-29 20:19:13 +02:00
- Build the [English Auction](code/week01) contract with `cabal build` (you may need to run `cabal update` first).
2021-04-08 12:15:17 +02:00
- Go to the `plutus-playground-client` folder.
- Start the Playground server with `plutus-playground-server`.
- Start the Playground client (in another `nix-shell`) with `npm run start`.
2021-06-29 20:19:13 +02:00
- Copy-paste the auction contract into the Playground editor.
2021-04-08 12:15:17 +02:00
- Compile.
- Simulate various auction scenarios.
2021-07-07 23:29:58 +02:00
- Week #2
- Fix and complete the code in the [Homework1](code/week02/src/Week02/Homework1.hs) module.
- Fix and complete the code in the [Homework2](code/week02/src/Week02/Homework2.hs) module.
2021-07-14 21:06:45 +02:00
- Week #3
- Fix and complete the code in the [Homework1](code/week03/src/Week03/Homework1.hs) module.
- Fix and complete the code in the [Homework2](code/week03/src/Week03/Homework2.hs) module.
2021-07-21 13:14:27 +02:00
- Week #4
- Implement function `payTrace` in the [Homework](code/week04/src/Week04/Homework.hs) module.
- Handle exceptions thrown by `submitTx` in function `payContract` in the same module.
2021-04-12 11:29:45 +02:00
## Some Plutus Modules
2021-06-03 01:07:19 +02:00
- [`Language.Marlowe.Semantics`](https://github.com/input-output-hk/plutus/blob/master/marlowe/src/Language/Marlowe/Semantics.hs), contains Marlowe types and semantics.
2021-05-20 00:35:48 +02:00
- [`Plutus.Contract.StateMachine`](https://github.com/input-output-hk/plutus/blob/master/plutus-contract/src/Plutus/Contract/StateMachine.hs), contains types and functions for using state machines.
2021-05-27 08:33:05 +02:00
- [`Plutus.Contract.Test`](https://github.com/input-output-hk/plutus/blob/master/plutus-contract/src/Plutus/Contract/Test.hs), provides various ways to write tests for Plutus contracts.
- [`Plutus.Contract.Test.ContractModel`](https://github.com/input-output-hk/plutus/blob/master/plutus-contract/src/Plutus/Contract/Test/ContractModel.hs), support for property based testing of Plutus contracts.
2021-06-10 10:32:29 +02:00
- [`Plutus.Contracts.Uniswap`](https://github.com/input-output-hk/plutus/blob/master/plutus-use-cases/src/Plutus/Contracts/Uniswap.hs), an implementation of Uniswap in Plutus.
2021-07-14 21:06:45 +02:00
- [`Plutus.Ledger.TimeSlot`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger/src/Ledger/TimeSlot.hs), conversions between `Slot` and `POSIXTime`.
2021-05-12 19:40:33 +02:00
- [`Plutus.PAB.Webserver.API`](https://github.com/input-output-hk/plutus/blob/master/plutus-pab/src/Plutus/PAB/Webserver/API.hs), contains the HTTP-interface provided by the PAB.
2021-04-27 09:14:58 +02:00
- [`Plutus.Trace.Emulator`](https://github.com/input-output-hk/plutus/blob/master/plutus-contract/src/Plutus/Trace/Emulator.hs), contains types and functions related to traces.
2021-05-05 21:46:44 +02:00
- [`Plutus.V1.Ledger.Ada`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Ada.hs), contains support for the Ada currency.
2021-04-18 22:49:27 +02:00
- [`Plutus.V1.Ledger.Contexts`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Contexts.hs), contains the definition of the context-related types.
- [`Plutus.V1.Ledger.Interval`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Interval.hs), contains the definition of and helper functions for the `Interval` type.
- [`Plutus.V1.Ledger.Slot`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Slot.hs), contains the definition of the `Slot` type.
2021-05-05 21:46:44 +02:00
- [`Plutus.V1.Ledger.Value`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Value.hs), contains the definition of and helper functions for the `Value` type.
2021-07-07 15:12:16 +02:00
- [`PlutusTx.Builtins.Data`](https://github.com/input-output-hk/plutus/blob/master/plutus-core/plutus-core/src/PlutusCore/Data.hs), contains the definition of the `Data` type.
2021-04-12 22:59:51 +02:00
- [`PlutusTx.IsData.Class`](https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/PlutusTx/IsData/Class.hs), defines the `IsData` class.
2021-04-12 11:29:45 +02:00
2021-04-08 12:07:47 +02:00
## Additional Resources
2021-04-08 12:15:17 +02:00
- [The Plutus repository](https://github.com/input-output-hk/plutus)
- [Learn You a Haskell for Great Good!](http://learnyouahaskell.com/)
2021-04-08 12:07:47 +02:00
- [Haskell & Cryptocurrencies course Mongolia](https://www.youtube.com/playlist?list=PLJ3w5xyG4JWmBVIigNBytJhvSSfZZzfTm)