Skip to content

Commit c893a8a

Browse files
committed
Improve metadata docs organization and navigation
1 parent eaf1376 commit c893a8a

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

versioned_docs/version-v6/background/solidity-metamask-compat.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,34 @@ slug: /background/solidity-metamask-compatibility
2323
With ink! v6, we have introduced an `abi` field in a custom `ink-lang` table
2424
in the [`package.metadata` table][package-metadata] of a contract's manifest
2525
file (i.e. the `Cargo.toml` file) - [more details here][abi-declaration].
26-
It allows building your contract in Solidity ABI compatibility mode.
26+
It allows building your contract in Solidity ABI compatibility mode
27+
when declared as follows:
2728

2829
```toml
2930
[package.metadata.ink-lang]
3031
abi = "sol"
3132
```
3233

33-
The implication of supporting Solidity ABI encoding is that all types used as constructor/message argument
34-
and return types, and event argument types must define a mapping to an equivalent Solidity ABI type.
34+
The implication of supporting Solidity ABI encoding is that all types used as
35+
constructor/message argument and return types, and event argument types must
36+
define a mapping to an equivalent Solidity ABI type.
3537

36-
This mapping is defined using the [`SolEncode`][sol-trait-encode] and [`SolDecode`][sol-trait-decode] traits,
37-
which are analogs to [`scale::Encode` and `scale::Decode`][scale-codec] (but for Solidity ABI encoding/decoding).
38+
[package-metadata]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table
39+
[abi-declaration]: ../basics/abi/overview.md#declaring-the-abi
40+
41+
## Rust/ink! to Solidity ABI type mapping
42+
43+
This mapping is defined using the [`SolEncode`][sol-trait-encode] and
44+
[`SolDecode`][sol-trait-decode] traits, which are analogs to
45+
[`scale::Encode` and `scale::Decode`][scale-codec]
46+
(but for Solidity ABI encoding/decoding).
3847
You won't be able to use Rust types for which no mapping to a Solidity type exists.
3948
An error about a missing trait implementation for this type will be thrown.
4049

41-
[package-metadata]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table
42-
[abi-declaration]: ../basics/abi#declaring-the-abi
4350
[sol-trait-encode]: https://docs.rs/ink/latest/ink/trait.SolEncode.html
4451
[sol-trait-decode]: https://docs.rs/ink/latest/ink/trait.SolEncode.html
4552
[scale-codec]: https://docs.rs/parity-scale-codec/latest/parity_scale_codec
4653

47-
## Rust/ink! to Solidity ABI type mapping
48-
4954
### Default/provided mappings
5055

5156
[`SolEncode`][sol-trait-encode] and [`SolDecode`][sol-trait-decode] are implemented

versioned_docs/version-v6/basics/metadata/metadata.md renamed to versioned_docs/version-v6/basics/metadata/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Metadata
2+
title: Overview
33
hide_title: true
44
slug: /basics/metadata
55
---
@@ -39,8 +39,8 @@ $ cargo contract build ---metadata <ink|solidity>
3939
```
4040

4141
Generating Solidity metadata is only possible if all constructor and message
42-
arguments and return types can be mapped to equivalent Solidity ABI types
43-
([more details here][sol-type-mapping]).
42+
argument and return types, and event argument types can be mapped to
43+
equivalent Solidity ABI types ([more details here][sol-type-mapping]).
4444

4545
[ethers-js]: https://docs.ethers.org/
4646
[sol-compat]: ../../background/solidity-metamask-compat.md

versioned_docs/version-v6/basics/selectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Selectors in ink! are a language agnostic way of identifying constructors and me
2929
They are four-byte hexadecimal strings which look something like: `0x633aa551`.
3030

3131
You can find the selector of an ink! constructor or message in your
32-
[contract metadata](./metadata/metadata.md) by looking for the `selector` field of the dispatchable
32+
[contract metadata](./metadata/overview.md) by looking for the `selector` field of the dispatchable
3333
you're interested in.
3434

3535
Here is an example of how you can grab the message name and selector from your contract

versioned_sidebars/version-v6-sidebars.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
{
4141
"type": "category",
4242
"label": "Metadata",
43-
"items": ["basics/metadata/ink-format", "basics/metadata/solidity-format"],
44-
"link": {
45-
"type": "doc",
46-
"id": "basics/metadata/metadata"
47-
}
43+
"items": [
44+
"basics/metadata/overview",
45+
"basics/metadata/ink-format",
46+
"basics/metadata/solidity-format"
47+
]
4848
},
4949
"basics/xcm",
5050
"basics/contract-verification"

0 commit comments

Comments
 (0)