Skip to content

Commit c696346

Browse files
Improve contract abi arg docs (use-ink#2473)
1 parent b62d859 commit c696346

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

crates/ink/macro/src/lib.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,8 @@ pub fn selector_bytes(input: TokenStream) -> TokenStream {
135135
/// # pub struct MyStorage;
136136
/// # impl MyStorage {
137137
/// # #[ink(constructor)]
138-
/// // #[bar]
139138
/// # pub fn construct() -> Self { MyStorage {} }
140139
/// # #[ink(message)]
141-
/// // #[foo]
142140
/// # pub fn message(&self) {}
143141
/// # }
144142
/// // ...
@@ -189,7 +187,7 @@ pub fn selector_bytes(input: TokenStream) -> TokenStream {
189187
/// (i.e. `abi = "sol"` or `abi = "all"`), all types used as constructor/message
190188
/// arguments and return types must define a mapping to an equivalent Solidity type.
191189
/// This mapping is defined using the [`SolEncode`][sol-trait-encode] and
192-
/// [`SolDecode`][sol-trait-decode] traits that are analogs to `scale::Encode` and
190+
/// [`SolDecode`][sol-trait-decode] traits, which are analogs to `scale::Encode` and
193191
/// `scale::Decode` (but for Solidity ABI encoding/decoding).
194192
///
195193
/// [`SolEncode`][sol-trait-encode] and [`SolDecode`][sol-trait-decode] are implemented
@@ -199,26 +197,26 @@ pub fn selector_bytes(input: TokenStream) -> TokenStream {
199197
/// | Rust/ink! type | Solidity ABI type | Notes |
200198
/// | -------------- | ----------------- | ----- |
201199
/// | `bool` | `bool` ||
202-
/// | `iN` for `N ∈ {8,16,32,64,128}` | `intN` | e.g `i8` <=> `int8` |
203-
/// | `uN` for `N ∈ {8,16,32,64,128}` | `uintN` | e.g `u8` <=> `uint8` |
200+
/// | `iN` for `N ∈ {8,16,32,64,128}` | `intN` | e.g `i8` `int8` |
201+
/// | `uN` for `N ∈ {8,16,32,64,128}` | `uintN` | e.g `u8` `uint8` |
204202
/// | [`ink::U256`][ink-u256] | `uint256` ||
205203
/// | `String` | `string` ||
206204
/// | [`ink::Address`][ink-address] / [`H160`][ink-h160] | `address` | `ink::Address` is a type alias for the `ink::H160` type used for addresses in `pallet-revive` |
207-
/// | `[T; N]` for `const N: usize` | `T[N]` | e.g. `[i8; 64]` <=> `int8[64]` |
208-
/// | `Vec<T>` | `T[]` | e.g. `Vec<i8>` <=> `int8[]` |
205+
/// | `[T; N]` for `const N: usize` | `T[N]` | e.g. `[i8; 64]` `int8[64]` |
206+
/// | `Vec<T>` | `T[]` | e.g. `Vec<i8>` `int8[]` |
209207
/// | [`ink::SolBytes<u8>`][ink-sol-bytes] | `bytes1` ||
210-
/// | [`ink::SolBytes<[u8; N]>`][ink-sol-bytes] for `1 <= N <= 32` | `bytesN` | e.g. `ink::SolBytes<[u8; 1]>` <=> `bytes1` |
208+
/// | [`ink::SolBytes<[u8; N]>`][ink-sol-bytes] for `1 <= N <= 32` | `bytesN` | e.g. `ink::SolBytes<[u8; 1]>` `bytes1` |
211209
/// | [`ink::SolBytes<Vec<u8>>`][ink-sol-bytes] | `bytes` ||
212-
/// | `(T1, T2, T3, ... T12)` | `(U1, U2, U3, ... U12)` | where `T1` <=> `U1`, ... `T12` <=> `U12` e.g. `(bool, u8, Address)` <=> `(bool, uint8, address)` |
210+
/// | `(T1, T2, T3, ... T12)` | `(U1, U2, U3, ... U12)` | where `T1` `U1`, ... `T12` `U12` e.g. `(bool, u8, Address)` `(bool, uint8, address)` |
213211
///
214212
/// [`SolEncode`][sol-trait-encode] is additionally implemented for reference and smart
215213
/// pointer types below:
216214
///
217215
/// | Rust/ink! type | Solidity ABI type | Notes |
218216
/// | -------------- | ----------------- | ----- |
219217
/// | `&str`, `&mut str`, `Box<str>` | string ||
220-
/// | `&T`, `&mut T`, `Box<T>` | T | e.g. `&i8 <=> int8` |
221-
/// | `&[T]`, `&mut [T]`, `Box<[T]>` | T[] | e.g. `&[i8]` <=> `int8[]` |
218+
/// | `&T`, `&mut T`, `Box<T>` | T | e.g. `&i8 int8` |
219+
/// | `&[T]`, `&mut [T]`, `Box<[T]>` | T[] | e.g. `&[i8]` `int8[]` |
222220
///
223221
/// See the rustdoc for [`SolEncode`][sol-trait-encode] and
224222
/// [`SolDecode`][sol-trait-decode] for instructions for implementing the traits for

0 commit comments

Comments
 (0)