Skip to content

Commit

Permalink
Merge pull request #533 from cardano-foundation/elviejo79-patch-4
Browse files Browse the repository at this point in the history
Correcting the last two formatting errors reported by Gerard.
  • Loading branch information
iohkwebdev committed Mar 4, 2021
2 parents 40172fd + a100186 commit 94470b2
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 215 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
---
parent: 2021-02-03_07-00-00_glow-tutorial
title: Buy Signature
description: Studying the buy signature contract
order: 2
last_updated: "2021-02-25T09:00:00+01:00"
---

# [Buy Signature](https://gitlab.com/mukn/glow/-/raw/master/dapps/buy_sig.glow)
## [Buy Signature](https://gitlab.com/mukn/glow/-/raw/master/dapps/buy_sig.glow)

Let's imagine you want to have your testament notarized. What would you do?

Expand Down Expand Up @@ -62,7 +62,5 @@ There are several things to note:
## Lessons learned

- Identify the participants of a contract with `@interaction`

- When an instruction is annotated with the participant's name, that value is private for the participant. Like `@verifiably!(Seller)`

- There are clear instructions for `deposit!` and `withdraw!`
180 changes: 0 additions & 180 deletions resources/content/articles/en/2021-02-03_07-00-00_challenge-en.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: How does Crowdfunding.glow work?
order: 7
last_updated: "2021-02-25T09:00:00+01:00"
---
*Warning:* This contract will compile on the /future/ Glow release.

## How does [crowdfunding.glow](https://gitlab.com/mukn/glow/-/blob/master/future/crowdfunding.glow) work?

In this day and age, crowdfunding campaigns are well known.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ description: How to create a deadman switch?
order: 5
last_updated: "2021-02-25T09:00:00+01:00"
---

*Warning:* This contract will compile on the /future/ Glow release.


## How to create a [deadman switch](https://gitlab.com/mukn/glow/-/blob/master/future/deadmanswitch.glow)?

Let's suppose a millionaire unlce has called you because he will give you the password to all his fortune.
However, while you are traveling to see your relative he passes away, and only he knew the password for the safe!
However, while you are traveling he passes away, and only he knew the password for the safe!

Six months later, you get an email with the password for the safe and it turns out that your uncle had a *dead man switch* that would automatically reveal the password.
Six months later, you get an email with the password.
It turns out that your uncle had a *dead man switch* that would automatically,
reveal the information after six months of inactivity.

In this contract, we are going to see how your uncle implemented that contract in Glow.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,16 @@ How does a player communicate their choice to the blockchain during the game?
- There are only three possible `Outcomes` either `B_wins`, `A_wins`, or its a `Draw`
- Now define a function `winner`, that when given two hands can determine the `Outcome`
- This is an arithmetic trick that translates each of the nine possible hand combinations to three possible outcomes

- Alice and Bob use this contract
- Declare the `rockPaperScissors` contract that has the `wagerAmount`
- `@Alice` makes sure (`assert!`) that it's possible to reach the `end:` label
- `@Alice` asks (`input`) and stores the value of her Hand.
- `@Alice` creates a random value (`salt`) that will be used to obfuscate her Hand
- `@Alice` store the obfuscated value of her Hand in a `verifiably` commitment
- `@Alice` makes her commitment public and `deposit!` her wage.

- `@Bob` makes sure he can reach the `end.outcome` where he wins
- `@Bob` can `input` what hand he chooses to play
- `@Bob` publishes his Hand and deposits his wager

- Now it's possible to publish the `salt` and in the next step, use it to
- `verify!` that the `commitment` was obfuscated with the salt
- now we calculate the `outcome` as the result of evaluating the `winner` function with both hands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: How does the Simple Auction (auction.glow) contract work?
order: 6
last_updated: "2021-02-25T09:00:00+01:00"
---

*Warning:* This contract will compile on the /future/ Glow release.

## How does the Simple Auction ([auction.glow](https://gitlab.com/mukn/glow/-/blob/master/future/auction.glow)) contract work?

Imagine an auction where each one of the bidders tries to outbid the previous bidder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ To install Glow, follow these steps:
1. Open a terminal window (or any application on your system that allows you to enter shell commands).
2. Type the following command:

curl -L [https://glow-lang.org/install/glow-install](https://glow-lang.org/install/glow-install) | sh
``` shell
curl -L https://glow-lang.org/install/glow-install | sh
```

This installation script first installs the [Nix](https://nixos.org/) package manager, which may require you to manually type yes, or y and/or type the administrator password to authorize parts of the installation. If you were not using Nix before, you may have to start a new shell for the PATH to be set up correctly and be able to run glow.

**Note**: If you use Linux or macOS on x86_64, all the binary packages for the software are cached, and the installation should only take a few minutes, depending on the speed of your internet connection. This software may require over 2GB of memory, so please ensure that you have enough available space on disk. If you use another platform, your computer may recompile code from source, so you should let it run overnight.

We plan to release a Docker image soon, so please check back for updates.
We plan to release a Docker image soon, so please check back for updates.

0 comments on commit 94470b2

Please sign in to comment.