Skip to content

Commit

Permalink
addressing all the old PR's that still had conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
wileyj committed Jul 8, 2024
1 parent b9fe0b4 commit 28cafff
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions clarity/clarity-crash-course.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Those two semicolons are how we denote comments in Clarity.

Then the next line down we have a public function declaration.

Here is out first glimpse of Clarity's syntax, which may be new to you depending on your development background.
Here is our first glimpse of Clarity's syntax, which may be new to you depending on your development background.

For those new to Clarity, it's a little weird and uncomfortable at first, but one of the core design tenets of Clarity is simplicity and readability, and the more you work with it the more you come to appreciate the succinctness and _clarity_ (sorry) of the code you are writing.

Expand Down Expand Up @@ -69,7 +69,7 @@ This will be a persistent state variable, so this is actually getting written to

So if we were to write and deploy this contract (which you can do in the Stacks Explorer if you like), as soon as it gets deployed, it will run through the contract line by line executing anything at the root level.

Remember that Clarity is interpreted, not compiled, so there's not compile step when developing Clarity contracts.
Remember that Clarity is interpreted, no compiled, so there's not compile step when developing Clarity contracts.

So this `define-data-var` will be evaluated and the `count` variable will be initialized with a value of 0.

Expand Down
6 changes: 6 additions & 0 deletions stacks-101/sips.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ More details of the meetings are available [here](https://github.com/stacksgov/s

### Ratified SIPSs

* [x] [SIP 000: Improvement Proposal Process](https://github.com/stacksgov/sips/blob/main/sips/sip-000/sip-000-stacks-improvement-proposal-process.md)
* [x] [SIP 001: Burn Election](https://github.com/stacksgov/sips/blob/main/sips/sip-001/sip-001-burn-election.md)
* [x] [SIP 002: Clarity, a language for predictable smart contracts](https://github.com/stacksgov/sips/blob/main/sips/sip-002/sip-002-smart-contract-language.md)
* [x] [SIP 003: Peer Network](https://github.com/stacksgov/sips/blob/main/sips/sip-003/sip-003-peer-network.md)
Expand All @@ -33,10 +34,15 @@ More details of the meetings are available [here](https://github.com/stacksgov/s
* [x] [SIP 009: Standard Trait Definition for Non-Fungible Tokens](https://github.com/stacksgov/sips/blob/main/sips/sip-009/sip-009-nft-standard.md)
* [x] [SIP 010: Standard Trait Definition for Fungible Tokens](https://github.com/stacksgov/sips/blob/main/sips/sip-010/sip-010-fungible-token-standard.md)
* [x] [SIP 012: Burn Height Selection for a Network Upgrade to Introduce New Cost-Limits](https://github.com/stacksgov/sips/blob/main/sips/sip-012/sip-012-cost-limits-network-upgrade.md)
* [x] [SIP 013: Standard Trait Definition for Semi-Fungible Tokens](https://github.com/stacksgov/sips/blob/main/sips/sip-013/sip-013-semi-fungible-token-standard.md)
* [x] [SIP-015: Stacks Upgrade of Proof-of-Transfer and Clarity](https://github.com/stacksgov/sips/blob/main/sips/sip-015/sip-015-network-upgrade.md)
* [x] [SIP-016: Metadata for Tokens](https://github.com/stacksgov/sips/blob/main/sips/sip-016/sip-016-token-metadata.md)
* [x] [SIP-018: Signed Structured Data](https://github.com/stacksgov/sips/blob/main/sips/sip-018/sip-018-signed-structured-data.md)
* [x] [SIP-019: Notifications for Token Metadata Updates](https://github.com/stacksgov/sips/blob/main/sips/sip-019/sip-019-token-metadata-update-notifications.md)
* [x] [SIP-020: Bitwise Operations in Clarity](https://github.com/stacksgov/sips/blob/main/sips/sip-020/sip-020-bitwise-ops.md)
* [x] [SIP-022: Emergency Fix to PoX Stacking Increases](https://github.com/stacksgov/sips/blob/main/sips/sip-022/sip-022-emergency-pox-fix.md)
* [x] [SIP-023: Emergency Fix to Trait Invocation Behavior](https://github.com/stacksgov/sips/blob/main/sips/sip-023/sip-023-emergency-fix-traits.md)
* [x] [SIP-024: Emergency Fix to Data Validation and Serialization Behavior](https://github.com/stacksgov/sips/blob/main/sips/sip-024/sip-024-least-supertype-fix.md)

### How to Get Involved

Expand Down
23 changes: 12 additions & 11 deletions stacks-in-depth/nodes-and-miners/mine-mainnet-stacks-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ First, download a [bitcoin binary](https://bitcoin.org/en/download), or [build f
If you want to learn more about the technical details of mining, please review the mining guide:

{% hint style="info" %}
**Tip:** It is recommened to use a persistent location for the chainstate, in the steps below we're using `/bitcoin`.
**Tip:** It is recommended to use a persistent location for the chainstate, in the steps below we're using `/bitcoin`.
{% endhint %}

#### Update the Bitcoin Configuration File
Expand Down Expand Up @@ -79,7 +79,7 @@ getblockchaininfo | jq .blocks
First, download the latest tagged [stacks blockchain binary](https://github.com/stacks-network/stacks-blockchain/releases/latest), or [build from source](https://github.com/stacksfoundation/miner-docs/blob/main/stacks-blockchain.md#build-and-install-stacks-blockchain-from-source) (_there may be some extra requirements to building,_ [_defined here_](https://github.com/stacksfoundation/miner-docs/blob/main/prerequisites.md#install-required-packages)).

{% hint style="info" %}
**Tip:** It is recommened to use a persistent location for the chainstate, in the steps below we're using `/stacks-blockchain`.
**Tip:** It is recommended to use a persistent location for the chainstate, in the steps below we're using `/stacks-blockchain`.
{% endhint %}

#### Generate a keychain
Expand Down Expand Up @@ -121,13 +121,14 @@ bitcoin-cli \
-rpcport=8332 \
-rpcuser=btcuser \
-rpcpassword=btcpass \
createwallet "miner" \
false \
false \
"" \
false \
false \
true
createwallet \
wallet_name="miner" \
disable_private_keys=false \
blank=false \
passphrase="" \
avoid_reuse=false \
descriptors=false \
load_on_startup=true
```

Now, import your wif (bitcoin private key) inside the newly created wallet.
Expand Down Expand Up @@ -156,7 +157,7 @@ bitcoin-cli \
getaddressinfo <btcAddress from JSON above>
```

Once imported, we need to get some BTC to that address. You should be able to transfer BTC to this address using a crytpocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com).
Once imported, we need to get some BTC to that address. You should be able to transfer BTC to this address using a cryptocurrency exchange such as [Coinbase](https://www.coinbase.com), [Binance](https://www.binance.com), or [Kraken](https://www.kraken.com).

#### Update the Stacks Blockchain Configuration File

Expand Down Expand Up @@ -231,7 +232,7 @@ We need to get some BTC to that address. You should be able to transfer BTC to t

#### Update Stacks Blockchain Docker Configuration File

Use the steps oulined above to create the configuration file.
Use the steps outlined above to create the configuration file.

#### Start the Stacks Blockchain miner with Docker

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To participate as a miner on testnet, you must have access to a testnet bitcoin
First, download a [bitcoin binary](https://bitcoin.org/en/download), or [build from source](https://github.com/stacksfoundation/miner-docs/blob/testnet/bitcoin.md#source-install) (_there may be some extra requirements to building,_ [_defined here_](https://github.com/stacksfoundation/miner-docs/blob/testnet/prerequisites.md#install-required-packages)).

{% hint style="info" %}
**Tip:** It is recommened to use a persistent location for the chainstate, in the steps below we're using `/bitcoin`.
**Tip:** It is recommended to use a persistent location for the chainstate, in the steps below we're using `/bitcoin`.
{% endhint %}

#### Update the Bitcoin Configuration File
Expand Down Expand Up @@ -81,7 +81,7 @@ getblockchaininfo | jq .blocks
First, download the latest tagged [stacks blockchain binary](https://github.com/stacks-network/stacks-blockchain/releases/latest), or [build from source](https://github.com/stacksfoundation/miner-docs/blob/testnet/stacks-blockchain.md#build-and-install-stacks-blockchain-from-source) (_there may be some extra requirements to building,_ [_defined here_](https://github.com/stacksfoundation/miner-docs/blob/testnet/prerequisites.md#install-required-packages)).

{% hint style="info" %}
**Tip:** It is recommened to use a persistent location for the chainstate, in the steps below we're using `/stacks-blockchain`.
**Tip:** It is recommended to use a persistent location for the chainstate, in the steps below we're using `/stacks-blockchain`.
{% endhint %}

#### Generate a keychain
Expand Down Expand Up @@ -247,7 +247,7 @@ Now, we need to get some tBTC. Grab the `btcAddress` field, and paste it into [t

#### Update Stacks Blockchain Docker Configuration File

Use the steps oulined above to create the configuration file.
Use the steps outlined above to create the configuration file.

#### Start the Stacks Blockchain miner with Docker

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Run a Node with a Hosted Provider

We're always looking for new hosting providers that enable anyone to run the Stacks Blockchain. Below, you'll find some examples on the current providers that are know to support running a node.
We're always looking for new hosting providers that enable anyone to run the Stacks Blockchain. Below, you'll find some examples of the current providers that are known to support running a node.

### Quicknode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Choose a plan (it will only allow you to select a droplet that meets the minimum

**Step 3**

Enter a root password or [enable SSH keys](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/) if your prefer.
Enter a root password or [enable SSH keys](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/) if you prefer.

**Step 4**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Using Leather's web wallet, we can easily initiate a simple Bitcoin transaction using only a few lines of code.

You'll need to be authenticated with the Leather wallet for this to work, with you can see how to do in the Authentication with Stacks.js tutorial.
You'll need to be authenticated with the Leather wallet for this to work, which you can see how to do in the Authentication with Stacks.js tutorial.

Once you have the wallet hooked up, you can use the Leather wallet API to initiate a simple Bitcoin transaction in your JS app like this.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Here's a basic example where we are calling [Blockstream's API](https://github.c

We can get all the information we need with nothing but the transaction ID, which will usually be passed to us when we use a wallet like [Hiro's web wallet](https://hirowallet.gitbook.io/developers/bitcoin/sign-transactions/sending-bitcoin) to initiate the Bitcoin transaction.

Let's go through the code we can use to implement this. For full context, this code is taken from the example [bitbadge](https://github.com/kenrogers/bitbadge) repo, which you can take a look at. For a complete ste-by-step walkthrough of how to implement this, check out the [Bitcoin Primer](https://bitcoinprimer.dev).
Let's go through the code we can use to implement this. For full context, this code is taken from the example [bitbadge](https://github.com/kenrogers/bitbadge) repo, which you can take a look at. For a complete step-by-step walkthrough of how to implement this, check out the [Bitcoin Primer](https://bitcoinprimer.dev).

Here's the mint function:

Expand Down
4 changes: 2 additions & 2 deletions tutorials/frontend/post-conditions-with-stacks.js.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Post Conditions with Stacks.js

The content in this recipe has ben pulled from the [tutorial on post conditions](https://dev.to/stacks/understanding-stacks-post-conditions-e65). Post conditions are an additional safety feature built into the Stacks chain itself that help to protect end users.
The content in this recipe has been pulled from the [tutorial on post conditions](https://dev.to/stacks/understanding-stacks-post-conditions-e65). Post conditions are an additional safety feature built into the Stacks chain itself that help to protect end users.

Rather than being a function of Clarity smart contracts, they are implemented on the client side and meant to be an additional failsafe against malicious contracts.

Put simply, post conditions are a set of conditions that must be met before a user's transaction will execute. The primary goal behind post conditions is to limit the amount of damage that can be done to a user's assets due to a bug, intentional or otherwise.

So they are sent as part of the transaction when the user initiates it, meaning we need a frontend library to utilize them.

Whenever you are transferring an asset (fungible or non-fungible) from one address to another, you should taker advantage of post conditions.
Whenever you are transferring an asset (fungible or non-fungible) from one address to another, you should take advantage of post conditions.

We're going to use [Stacks.js](https://github.com/hirosystems/stacks.js/tree/master/packages/transactions#post-conditions) to familiarize ourselves with them.

Expand Down
4 changes: 2 additions & 2 deletions tutorials/hello-stacks-quickstart-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ One of the coolest features of Clarinet is that it allows us to set up an entire

This comes complete with a local block explorer and sandbox environment so we can further test our contracts.

Make sure you have Docker installed and running, exit out of console with `CMD/CTRL + C` and run `clarinet integrate`.
Make sure you have Docker installed and running, exit out of console with `CMD/CTRL + C` and run `clarinet devnet start`.

It will take a few minutes to get up and running, but then we can open up our local Stacks block explorer.

Expand Down Expand Up @@ -247,7 +247,7 @@ Make sure you copy your secret key before you sign out. You'll need it to restor

Go ahead and copy the mnemonic listed in the `Devnet.toml` file and use that to import your local wallet into the Leather wallet. Then we can use that for interacting with our local Devnet chain.

Once you do that, go ahead and restart `clarinet integrate`.
Once you do that, go ahead and restart `clarinet devnet start`.

Now we can go back to the sandbox and call that function. You might need to sign out of the sandbox first and reauthenticate.

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tokens/creating-a-nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The official mainnet trait can be [found on the Stacks Explorer](https://explore
)
```

All we are doing here is defining the function signatures for functions we'll need to implement in out Clarity contract, which we can see a simple version of below.
All we are doing here is defining the function signatures for functions we'll need to implement in our Clarity contract, which we can see a simple version of below.

### Clarity Code

Expand Down

0 comments on commit 28cafff

Please sign in to comment.