Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
51 changes: 0 additions & 51 deletions docs/datastructures/dynamic-allocation.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/datastructures/mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case, each "user" gets their own number.

In order to correctly initialize a `Mapping` we need two things:
1. An implementation of the [`SpreadAllocate`](https://paritytech.github.io/ink/ink_storage/traits/trait.SpreadAllocate.html) trait on our storage struct
2. The [`ink_lang::utils::initalize_contract`](https://paritytech.github.io/ink/ink_lang/codegen/fn.initialize_contract.html) initializer
2. The [`ink_lang::utils::initalize_contract`](https://paritytech.github.io/ink/ink_lang/utils/fn.initialize_contract.html) initializer

Not initializing storage before you use it is a common error that can break your smart
contract. If you do not initialize your `Mapping`'s correctly you may end up with
Expand Down
25 changes: 0 additions & 25 deletions docs/datastructures/opting-out.md

This file was deleted.

45 changes: 0 additions & 45 deletions docs/macros-attributes/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,51 +33,6 @@ off-chain environment provided by the `ink_env` crate.
The `#[ink::contract]` macro can be provided with some additional comma-separated
header arguments:

### `dynamic_storage_allocator: bool`

Tells the ink! code generator to allow usage of ink!'s built-in dynamic
storage allocator.
- `true`: Use the dynamic storage allocator provided by ink!.
- `false`: Do NOT use the dynamic storage allocator provided by ink!.

This feature is generally only needed for smart contracts that try to model
their data in a way that contains storage entites within other storage
entities.

Contract writers should try to write smart contracts that do not depend on the
dynamic storage allocator since enabling it comes at a cost of increased Wasm
file size. Although it will enable interesting use cases. Use it with care!

An example for this is the following type that could potentially be used
within a contract's storage struct definition:
```rust
// A storage vector of storage vectors.
use ink_storage as storage;
type VectorOfVectors = storage::Vec<storage::Vec<i32>>;
```

**Usage Example:**
```rust
use ink_lang as ink;

#[ink::contract(dynamic_storage_allocator = true)]
mod my_contract {
#[ink(storage)]
pub struct MyStorage;

impl MyStorage {
#[ink(constructor)]
pub fn construct() -> Self { MyStorage {} }

#[ink(message)]
pub fn message(&self) {}
}
// ...
}
```

**Default value:** `false`

### `compile_as_dependency: bool`

Tells the ink! code generator to **always** or **never**
Expand Down
2 changes: 0 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ module.exports = {
'datastructures/overview',
'datastructures/mapping',
'datastructures/spread-storage-layout',
'datastructures/opting-out',
'datastructures/dynamic-allocation',
'datastructures/custom',
],
'Examples': [
Expand Down