All Questions
Tagged with storage smart-contract
7 questions
3
votes
1
answer
136
views
What is a Storage Deposit?
When developing ink smart contracts, I've often seen a Storage Deposit charge. What is this, and how does it relate to contract storage?
My guess is it's a charge related to the size of the contract's ...
5
votes
1
answer
84
views
How do I upgrade an ink contract with storage changes?
Let's say I have a simple/contrived ink contract:
#[ink(storage)
pub struct MyContract {
a: u8,
b: u8,
}
Now let's say it's in production and a == 1 and b == 2.
I've done some work and ...
3
votes
0
answers
32
views
How to migrate / backup & restore ink smart contract storage?
Is there a way to backup ink smart contract storage and later restore on another chain? Lets say we have chain with 3 validators and deployed smart contract containing certain information in its ...
0
votes
1
answer
79
views
Query returning all instances of a contract based on it's code hash?
Looking to write a call that could return all the contract addresses of ink contracts matching a code hash of the contract via RPC.
What would be the best way to go about getting the list of contract ...
1
vote
1
answer
48
views
Ink Contracts: What Data Structures/Situations Are Best Suited To Contract Storage vs Events?
Using events to write data to the chain is great for registering information to the chain, especially information that you want a permanent record of. So my question is: under what circumstances ...
0
votes
1
answer
56
views
How to use Mapping with Sha2x256 in ink smart contracts
I want to try and use Mapping with Sha2x256 or any other value that is large enough so that each of these will be unique.
I want mapping to be like this:
unique_ids: Mapping <Sha2x256 ,u128>
...
0
votes
2
answers
119
views
How to store a enumerations in smart contracts with ink?
How to store enumeration in smart contract with ink!
I have a field in smart contract with type Mapping<AccountId, Enum>, I tried to use guide https://ink.substrate.io/datastructures/custom-...