From c1e0a4482d33bdb02a6ae75ae0ee8c26d1166098 Mon Sep 17 00:00:00 2001 From: 0xf333 <0x333@tuta.io> Date: Sun, 27 Aug 2023 16:47:53 -0400 Subject: [PATCH] doc: Update Mapping Declaration Section Upadate ink! mapping syntax to comform with ink v4 Description =========== - Removed unnecessary imports. - Updated the ink! mapping syntax. - Removed outdated reference to `ink_lang::utils::initialize_contract`. --- docs/intro/ink-vs-solidity.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/intro/ink-vs-solidity.md b/docs/intro/ink-vs-solidity.md index a49232f8bc..4248652f6b 100644 --- a/docs/intro/ink-vs-solidity.md +++ b/docs/intro/ink-vs-solidity.md @@ -262,20 +262,14 @@ mapping(address => uint128) private mapName; ```rust //ink! -use ink_storage::{ - traits::SpreadAllocate, - Mapping, -}; +use ink::storage::Mapping; #[ink(storage)] -#[derive(SpreadAllocate)] pub struct ContractName { map_name: Mapping, } ``` -When using a map in ink!, `ink_lang::utils::initialize_contract` must be used in the constructor. See [here](https://use.ink/datastructures/mapping) for more details. - ### `mapping usage` ```c++