@ -153,7 +153,7 @@ The script will process that file and pull out the title from the frontmatter of
### Non-standard pages
There are a few pages within these docs that are non-standard markdown pages. This means they are using some kind of external data as their source,
such as the [Clarity Reference page](/references/clarity-language), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called
such as the [Clarity Reference page](/references/language-clarity), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called
[`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) which allows us to
fetch external data at runtime and use it in some way within our pages.
@ -132,14 +132,14 @@ Let's get familiar with the tests to understand what the new smart contract shou
(ok (var-get counter)))
```
The [`define-data-var`](/references/clarity-language#define-data-var) statement initializes a
The [`define-data-var`](/references/language-clarity#define-data-var) statement initializes a
new integer variable named `counter` and sets the value to `0`. It is important to note that all definition statements
in Clarity need to be at the top of the file.
The `counter` variable is stored in the data space associated with the smart contract. The variable is persisted and
acts as the global shared state.
To provide access to the `counter` variable from outside of the current smart contract, we need to declare a public function to get it. The last lines of the code add a public `get-counter` function. The [`var-get`](/references/clarity-language#var-get) statement looks for a variable in the contract's data space and returns it.
To provide access to the `counter` variable from outside of the current smart contract, we need to declare a public function to get it. The last lines of the code add a public `get-counter` function. The [`var-get`](/references/language-clarity#var-get) statement looks for a variable in the contract's data space and returns it.
With that, you are ready to rerun the tests!
@ -163,9 +163,9 @@ Let's get familiar with the tests to understand what the new smart contract shou
(ok (var-get counter))))
```
First, the [`begin`](/references/clarity-language#begin) statement evaluates multiple expressions and returns the value of the last one. In this case, it is used to set a new value and return the new value.
First, the [`begin`](/references/language-clarity#begin) statement evaluates multiple expressions and returns the value of the last one. In this case, it is used to set a new value and return the new value.
Next, a [`var-set`](/references/clarity-language#var-set) is used to set a new value for the `counter` variable. The new value is constructed using the [`+`](/references/clarity-language#-add) (add) statement. This statement takes a number of integers and returns the result. Along with add, Clarity provides statements to subtract, multiply, and divide integers. Find more details in the [Clarity language reference](/references/clarity-language).
Next, a [`var-set`](/references/language-clarity#var-set) is used to set a new value for the `counter` variable. The new value is constructed using the [`+`](/references/language-clarity#-add) (add) statement. This statement takes a number of integers and returns the result. Along with add, Clarity provides statements to subtract, multiply, and divide integers. Find more details in the [Clarity language reference](/references/language-clarity).
5. Next, implement a new public function `decrement` to subtract `1` from the `counter` variable. You should have all knowledge needed to succeed at this!
@ -83,9 +83,9 @@ On the first line, a new public function `say-hi` is declared. Public functions
-> To create private functions, you would use the `define-private` keyword. Private functions can only be executed by the current smart contract. Only public functions can be called from other contracts.
The function doesn't take any parameters and simply returns "hello world" using the [`ok`](/references/clarity-language#ok) response constructor.
The function doesn't take any parameters and simply returns "hello world" using the [`ok`](/references/language-clarity#ok) response constructor.
The second function, `echo-number`, is a [read-only function](/references/clarity-language#define-read-only). Read-only functions are also public, but as the name implies, they can not change and variables or datamaps. `echo-number` takes an input parameter of the type `int`. Along with integer, Clarity supports the following [types](/references/clarity-language#clarity-type-system):
The second function, `echo-number`, is a [read-only function](/references/language-clarity#define-read-only). Read-only functions are also public, but as the name implies, they can not change and variables or datamaps. `echo-number` takes an input parameter of the type `int`. Along with integer, Clarity supports the following [types](/references/language-clarity#clarity-type-system):
- `uint`: 16-byte unsigned integer
- `principal`: spending entity, roughly equivalent to a Stacks address
@ -93,7 +93,7 @@ The second function, `echo-number`, is a [read-only function](/references/clarit
- `buffer`: fixed-length byte buffers
- `tuple`: named fields in keys and values
`echo-number` uses an [`ok`](/references/clarity-language#ok) response to return the value passed to the function.
`echo-number` uses an [`ok`](/references/language-clarity#ok) response to return the value passed to the function.
| contractAddress | string | false | The Stacks address that published this contract |
| contractName | string | false | The name that was used when publishing this contract |
| functionName | string | false | The name of the function you're calling. This needs to be a [public function](/references/clarity-language#define-public). |
| functionName | string | false | The name of the function you're calling. This needs to be a [public function](/references/language-clarity#define-public). |
| functionArgs | array | false | The arguments you're calling the function with. You'll need to provide the Clarity type with each argument. See the below section for details. Defaults to `[]`. |
| appDetails | object | false | A dictionary that includes `name` and `icon` |
| finished | function | false | A callback that is fired when the transaction is signed and broadcasted. Your callback will receive an object back with a `txId` and a `txRaw`, both of which are strings. |