-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from LovelaceAcademy/add-m11
Add M11 - A Vesting Contract II
- Loading branch information
Showing
57 changed files
with
18,759 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: M11 - A Vesting Contract II | ||
author: Walker Leite | ||
--- | ||
# Introduction | ||
|
||
## Getting Started | ||
|
||
In this module we'll build the vesting contract UI | ||
|
||
To run this presentation type (you will need [nix](https://nixos.org)): | ||
|
||
```sh | ||
../../slide README.md | ||
``` | ||
|
||
### Community Support | ||
|
||
- [LovelaceAcademy Discord](https://discord.gg/fWP9eGdfZ8) | ||
- [StackExchange](https://cardano.stackexchange.com/) (:bulb: use the tag lovelace-academy) | ||
- [Plutonomicon Discord](https://discord.gg/gGFdGaUE) | ||
|
||
[![Module Video](https://img.youtube.com/vi/bRhs0lxg3J8/0.jpg)](https://www.youtube.com/watch?v=bRhs0lxg3J8&list=PLHJ1yaDcSSaflXUWFHQV2L5FeyFt7fjN7) | ||
|
||
## What you should know | ||
|
||
- Vesting contract contract (module 10) | ||
- Halogen (modules 7 and 8); | ||
- Although not required, [variants](https://github.com/natefaubion/purescript-variant) will be useful for [halogen-formless](https://github.com/thomashoneyman/purescript-halogen-formless). | ||
|
||
# Breakthrough: Building the Vesting Contract UI | ||
|
||
## Description | ||
|
||
> As a donator I want to lock an ADA value in a contract, to be rewarded to a given beneficiary according a given deadline | ||
> As the beneficiary I want to reclaim the locked ADA value only after the deadline | ||
## Bootstrap | ||
|
||
```bash | ||
cp -Rf modules/M10-a-vesting-contract-i modules/M11-a-vesting-contract-ii | ||
``` | ||
|
||
## Links | ||
|
||
- [DaisyUI](https://daisyui.com/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
inputs.horizon-wave-ocean.url = "git+https://gitlab.homotopic.tech/horizon/wave-ocean/horizon-wave-ocean-platform"; | ||
inputs.nixpkgs.follows = "horizon-wave-ocean/nixpkgs"; | ||
inputs.utils.url = "github:ursi/flake-utils"; | ||
|
||
outputs = { self, utils, ... }@inputs: | ||
utils.apply-systems | ||
{ | ||
inherit inputs; | ||
# TODO support additional systems on hor | ||
# horizon-platform is only supporting linux | ||
systems = [ "x86_64-linux" ]; | ||
} | ||
({ pkgs, system, ... }: | ||
let | ||
hsPkgs = | ||
with pkgs.haskell.lib; | ||
inputs.horizon-wave-ocean.legacyPackages.${system}.extend (hfinal: hprev: | ||
{ | ||
vesting-contract = disableLibraryProfiling (hprev.callCabal2nix "vesting-contract" ./. { }); | ||
}); | ||
script = pkgs.runCommand "script" | ||
{ | ||
buildInputs = [ hsPkgs.vesting-contract ]; | ||
} | ||
''vesting-contract > $out''; | ||
script-check = pkgs.runCommand "script-check" { } | ||
''cat ${script}; touch $out''; | ||
in | ||
{ | ||
packages.default = hsPkgs.vesting-contract; | ||
packages.script = script; | ||
|
||
devShells.default = hsPkgs.vesting-contract.env.overrideAttrs (attrs: { | ||
buildInputs = with pkgs; attrs.buildInputs ++ [ | ||
cabal-install | ||
]; | ||
}); | ||
|
||
checks.default = script-check; | ||
}); | ||
|
||
# --- Flake Local Nix Configuration ---------------------------- | ||
nixConfig = { | ||
# This sets the flake to use nix cache. | ||
# Nix should ask for permission before using it, | ||
# but remove it here if you do not want it to. | ||
extra-substituters = [ | ||
"https://klarkc.cachix.org?priority=99" | ||
"https://cache.iog.io" | ||
"https://cache.zw3rk.com" | ||
"https://cache.nixos.org" | ||
"https://hercules-ci.cachix.org" | ||
]; | ||
extra-trusted-public-keys = [ | ||
"klarkc.cachix.org-1:R+z+m4Cq0hMgfZ7AQ42WRpGuHJumLLx3k0XhwpNFq9U=" | ||
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" | ||
"loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" | ||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" | ||
"hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0=" | ||
]; | ||
allow-import-from-derivation = "true"; | ||
}; | ||
} |
Oops, something went wrong.