Skip to content

Commit

Permalink
Merge master branch (#7)
Browse files Browse the repository at this point in the history
* Use custom home icon (use-ink#102)

Swizzled the home icon via:

	yarn swizzle @docusaurus/theme-classic Icon/Home --danger

Generated the SVG for the code via:

	npx @svgr/cli <  Breadcrumb.svg

* Added Solidity -> ink! guide (use-ink#97)

* Added Solidity -> ink! guide

* replaced broken links

* Removed no-longer necessary text. Improved some sentence structures.

* Add monthly update for October (use-ink#105)

* Tune text

* Execute `yarn upgrade` (use-ink#106)

* Add link to blog post

* Less text on landing page

* --dev flag implies --tmp (use-ink#107)

* Execute `yarn upgrade`

* Upgrade to docusaurus v2.2.0 (use-ink#108)

* Bump loader-utils from 2.0.3 to 2.0.4 (use-ink#111)

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](webpack/loader-utils@v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add November 2022 Monthly Update (use-ink#113)

* Add November monthly update

* Add Sardinia team photo

* Fill out Sub0 section

* Add photo of fireside chat

* Small fixes for November update (use-ink#114)

* Add Novermber update to sidebar

* Add cropped fireside chat image

* Re-order dependency installation steps (use-ink#117)

* Use openbrush (use-ink#120)

* use openbrush

* add info how to add openbrush to project

* Update openbrush.md

* Improve landingpage (use-ink#123)

* Add and update monthly updates (use-ink#124)

* Add and update monthlies

* Fix broken links

* Adding the structure for support for spanish Documentation (use-ink#104) (use-ink#125)

* config docs in spanish + overview translation

* added support for translating versioning docs

Co-authored-by: Santi Balaguer <santibalaguer@Santis-MacBook-Pro.local>

Co-authored-by: Santi Balaguer <santiago.balaguer@gmail.com>
Co-authored-by: Santi Balaguer <santibalaguer@Santis-MacBook-Pro.local>

* Improve 4.0 landingpage (use-ink#126)

* Update setup.md (use-ink#118)

Use a more recent version that doesn't have strange rpc dependancies as noted here paritytech/substrate#12358

* Update `contracts-node` version everywhere

* Added usage of Enum in basics-storing values page  (use-ink#119)

* add example of string, hash and Enum

* add example of string, hash and Enum

* Update docs/basics/storing-values.md

* Update docs/basics/storing-values.md

Co-authored-by: Michael Müller <mich@elmueller.net>

* Add info about enum storage to versioned page and i18n pages

* Execute `yarn upgrade`

* Support icons in page title

* Improve structure

* Add content for ink! 4.0 + Add ToDo's (use-ink#127)

* Update information on Rococo testnet (use-ink#128)

* Add layout improvements (use-ink#129)

* Use custom info icon

Generated via

	yarn swizzle @docusaurus/theme-classic Admonition -- --wrap

* Update schemas with illustrations

* Add icon for FAQ

* Add FAQ icon

* Make code consistent

* Update ink! vs. Solidity docs

* Fix JSON

* Add more ToDo's for 4.0

* Add more ToDo's for 4.0

* Add documentation of `Environment` trait

* Highlight ToDo annotations

* Explain the `cargo contract new` template (use-ink#131)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Michael Müller <mich@elmueller.net>
Co-authored-by: Peter White <23270067+peterwht@users.noreply.github.com>
Co-authored-by: Squirrel <giles@parity.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
Co-authored-by: Dan Quirk <danieljquirk@gmail.com>
Co-authored-by: Dominik | 727 <43150707+coreggon11@users.noreply.github.com>
Co-authored-by: Santi Balaguer <santiago.balaguer@gmail.com>
Co-authored-by: Santi Balaguer <santibalaguer@Santis-MacBook-Pro.local>
Co-authored-by: slmagus <vida.zach@gmail.com>
Co-authored-by: kirti purohit <58950467+Irene-123@users.noreply.github.com>
  • Loading branch information
12 people committed Jan 24, 2023
1 parent 077e02d commit d88892e
Show file tree
Hide file tree
Showing 107 changed files with 7,250 additions and 3,897 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@ dist
*.sqlite
*.sqlite-journal
.fuse_*
.docusaurus
.docusaurus

# Mac
.DS_Store
6 changes: 3 additions & 3 deletions docs/basics/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ It may _optionally_ contain the following keys:
]
},
"V3": {
"spec": { ... },
"storage": { ... },
"types": { ... }
"spec": {...},
"storage": {...},
"types": {...}
}
}
```
Expand Down
35 changes: 35 additions & 0 deletions docs/basics/storing-values.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,41 @@ mod MyContract {
}
```

Here is an example of a structure storing `String` and `Hash` values.

```rust
pub struct Auction {
/// Branded name of the auction event.
name: String,
/// Some hash identifying the auction subject.
subject: Hash,
/// Auction status.
status: Status, // Enum: Usage shown in next section
/// Candle auction can have no winner.
/// If auction is finalized, that means that the winner is determined.
finalized: bool,
/// vector
vector: Vec<u8>,
}
```

## Use of enum

Enum can be used as a datatype in `struct` as depicted above in `struct Auction`

```rust
pub enum Status {
/// An auction has not started yet.
NotStarted,
/// We are in the starting period of the auction, collecting initial bids.
OpeningPeriod,
/// We are in the ending period of the auction, where we are taking snapshots
/// of the winning bids.
}
```

The values of an enum should be referenced as `Status::OpeningPeriod`.

## Initializing Storage in Constructors

Constructors are how values get initialized.
Expand Down
2 changes: 1 addition & 1 deletion docs/faq/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ you compile a contract in `--release` mode.
1. __Set the log level of your node to `runtime::contracts=debug`.__<br/>
For example, to have only errors and debug output show up for the `substrate-contracts-node`:
```
substrate-contracts-node --dev --tmp -lerror,runtime::contracts=debug
substrate-contracts-node --dev -lerror,runtime::contracts=debug
```

__Important: Debug output is only printed for RPC calls or off-chain tests ‒ not for transactions!__
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It's a comfortable option if you want to get a quickstart.
[After successfully installing `substrate-contracts-node`](/getting-started/setup), you can start a local development chain by running:

```bash
substrate-contracts-node --dev --tmp
substrate-contracts-node --dev
```

![An image of the terminal starting a Substrate node](./assets/start-substrate-node.png)
Expand Down
14 changes: 7 additions & 7 deletions docs/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ The first tool we will be installing is [`cargo-contract`](https://github.com/pa

As a pre-requisite for the tool you need to install the [binaryen](https://github.com/WebAssembly/binaryen) package, which is used to optimize the WebAssembly bytecode of the contract.

Two other dependencies are needed to lint the ink! contract. This is done to warn users about using e.g. API's in a way that could lead to security issues.

```bash
cargo install cargo-dylint dylint-link
```

Many package managers have it available nowadays ‒ e.g. there is a package for [Debian/Ubuntu](https://tracker.debian.org/pkg/binaryen),
[Homebrew](https://formulae.brew.sh/formula/binaryen) and [Arch Linux](https://archlinux.org/packages/community/x86_64/binaryen/).

Expand All @@ -37,6 +31,12 @@ Use the `--force` to ensure you are updated to the most recent `cargo-contract`

You can then use `cargo contract --help` to start exploring the commands made available to you.

Two other dependencies are needed to lint the ink! contract. This is done to warn users about using e.g. API's in a way that could lead to security issues.

```bash
cargo install cargo-dylint dylint-link
```

## Substrate Framework Pre-requisites

With ink! you can write smart contracts for blockchains built on Substrate.
Expand All @@ -62,5 +62,5 @@ You can [download a binary from our releases page](https://github.com/paritytech
(Linux and Mac). Alternatively you can build the node by yourself:

```bash
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.17.0 --force --locked
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.23.0 --force --locked
```
2 changes: 1 addition & 1 deletion docs/getting-started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There is a known issue with the Substrate block production (BABE) on a running c
ClientImport("Unexpected epoch change")
```

To solve this you will need to restart your node with: `substrate-contracts-node --dev --tmp`. At that point, you will
To solve this you will need to restart your node with: `substrate-contracts-node --dev`. At that point, you will
need to re-deploy any contracts and re-do any steps that you may have done before on your node. As
long as you keep your node running, you should face no issues.

Expand Down
6 changes: 3 additions & 3 deletions docs/intro/ink-vs-cosmwasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ink! contracts can be deployed on a few different options:
## Dependencies

The first step in CosmWasm development is to
[install dependencies](https://docs.cosmwasm.com/docs/1.0/getting-started/installation),
[install dependencies](https://docs.cosmwasm.com/docs/getting-started/installation),
namely Go, Rust and `wasmd`.

For ink! you can also find [a setup guide](/getting-started/setup) which will help you
Expand All @@ -99,7 +99,7 @@ with dependencies, namely Rust, `cargo-contract` and `substrate-contracts-node`.
## Environment Setup

The next step in the CosmWasm development workflow is
[setting up the environment](https://docs.cosmwasm.com/docs/1.0/getting-started/setting-env).
[setting up the environment](https://docs.cosmwasm.com/docs/getting-started/setting-env).
That consists mainly of configuring `wasmd` such that it has prefunded accounts that are able
to interact with the network.

Expand Down Expand Up @@ -137,7 +137,7 @@ $ cargo test
## Deploy and Interact

CosmWasm contracts are deployed and instantiated with help of the `wasmd` executable. The
list of step is provided [here](https://docs.cosmwasm.com/docs/1.0/getting-started/interact-with-contract).
list of step is provided [here](https://docs.cosmwasm.com/docs/getting-started/interact-with-contract).

It is possible to deploy and interact with ink! contracts using either a CLI
(`cargo-contract`), or a web UI ([`contracts-ui`](https://contracts-ui.substrate.io/)).
Expand Down
Loading

0 comments on commit d88892e

Please sign in to comment.