Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master branch #7

Merged
merged 39 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4d872f1
Use custom home icon (#102)
cmichi Oct 24, 2022
5d34729
Added Solidity -> ink! guide (#97)
peterwht Oct 25, 2022
cd22250
Add monthly update for October (#105)
cmichi Oct 27, 2022
c878e3b
Tune text
cmichi Oct 27, 2022
8af1da2
Execute `yarn upgrade` (#106)
cmichi Oct 27, 2022
7a201aa
Add link to blog post
cmichi Oct 31, 2022
7e92eb1
Less text on landing page
cmichi Oct 31, 2022
e6a1ed1
--dev flag implies --tmp (#107)
Oct 31, 2022
cdabfbb
Execute `yarn upgrade`
cmichi Nov 1, 2022
6a19f79
Upgrade to docusaurus v2.2.0 (#108)
cmichi Nov 2, 2022
f6960da
Bump loader-utils from 2.0.3 to 2.0.4 (#111)
dependabot[bot] Nov 16, 2022
0f2e402
Add November 2022 Monthly Update (#113)
HCastano Nov 30, 2022
c43d89d
Small fixes for November update (#114)
HCastano Nov 30, 2022
2522253
Re-order dependency installation steps (#117)
kureus Dec 11, 2022
5e922cf
Use openbrush (#120)
coreggon11 Dec 29, 2022
ec9de61
Improve landingpage (#123)
cmichi Jan 17, 2023
fb8f8e9
Add and update monthly updates (#124)
cmichi Jan 18, 2023
e84f345
Adding the structure for support for spanish Documentation (#104) (#125)
cmichi Jan 18, 2023
0aacf94
Improve 4.0 landingpage (#126)
cmichi Jan 18, 2023
09332f0
Update setup.md (#118)
slmagus Jan 18, 2023
94cdc3f
Update `contracts-node` version everywhere
cmichi Jan 18, 2023
1f5e899
Added usage of Enum in basics-storing values page (#119)
Irene-123 Jan 18, 2023
f8d3cde
Add info about enum storage to versioned page and i18n pages
cmichi Jan 18, 2023
27ba4ea
Execute `yarn upgrade`
cmichi Jan 18, 2023
f1988a7
Support icons in page title
cmichi Jan 18, 2023
48fda63
Improve structure
cmichi Jan 18, 2023
c63dfac
Add content for ink! 4.0 + Add ToDo's (#127)
cmichi Jan 18, 2023
140e56e
Update information on Rococo testnet (#128)
cmichi Jan 18, 2023
4483ce3
Add layout improvements (#129)
cmichi Jan 19, 2023
cc953f2
Add FAQ icon
cmichi Jan 19, 2023
ed4aeaf
Make code consistent
cmichi Jan 20, 2023
bd97fee
Update ink! vs. Solidity docs
cmichi Jan 20, 2023
8830fcb
Fix JSON
cmichi Jan 20, 2023
0bbcb40
Add more ToDo's for 4.0
cmichi Jan 20, 2023
edde5bf
Add more ToDo's for 4.0
cmichi Jan 20, 2023
6d2939c
Add documentation of `Environment` trait
cmichi Jan 20, 2023
16a4786
Highlight ToDo annotations
cmichi Jan 20, 2023
c62c2e6
Explain the `cargo contract new` template (#131)
cmichi Jan 20, 2023
51c98ee
merge master
AlexD10S Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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