Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

0
votes
1answer
18 views

cypto-signing in a smart contract -> verify the identity of a smart contract

my Question in short is: -> is it possible to digitally sign some data by a smart contract (e.g. with a secret key of the contract) and thus confirm that it was exactly this smart contract, who ...
0
votes
2answers
22 views

How to check if element of struct array has been deleted?

So let's say that I have struct A and an array A[] of struct A's I then fill 3 first indexes of A[] with some A's. I then delete second index of A[] and and want to test if it has been deleted. In ...
0
votes
2answers
31 views

How can I store and read data from Etherum blockchain? [closed]

I'm doing a project and I want to store some basic information on Etherum, for example: Name, ID, Height, Weight. How can I store this on the blockchain and after that be availble to read it. I read ...
1
vote
0answers
13 views

Gas cost of adding an item to a class-level (storage) array

I would like to make sure that the gas cost of adding an item to a (storage) array is constant, i.e., not dependent on the length of the array. To my understanding, the relevant EVM operation is ...
1
vote
1answer
52 views

Does Ethereum Swarm work?

I need to upload 8Tb data to Swarm. I read docs but I can't understand: does public swarm work?
2
votes
1answer
25 views

Data Search Complexity in Ethereum

I am new to Ethereum and wish to know that how is data for a smart contract fetched in Ethereum Blockchain. When we store the value of a variable in a smart contract, say simple storage (https://...
0
votes
1answer
16 views

Delete function affects my array in my struct

I am using the function mentioned below to delete a user (i added delete entityList[rowToDelete] to the function )My main issue is that the function deletes the user but somehow I lose the data in ...
1
vote
0answers
23 views

How can we calculate swarm storage cost?

I am trying to integrate ethereum to another fin-tech app, the basic idea is to store the transaction details on swarm and then pass the hash on ethereum network. I haven't used swarm earlier and I am ...
0
votes
1answer
38 views

Creating an automatically ordered pledge list. Can I do better in terms of gas?

Inspired by What's the best way to return top X values in a mapping? and Are there well-solved and simple storage patterns for Solidity?, I've created a data structure that automatically orders ...
3
votes
1answer
45 views

Why time values should be used as uint256?

Is there a reason to use the time value as uint256? Is not uint128 enough? UnixTime...
0
votes
1answer
47 views

pass an array as parameter in solidity

As far as i know solidity doesn't support passing an array of strings into a function ? My issue is that i just added an array of strings (hashs from ipfs) into my struct and i am used to use the ...
3
votes
2answers
89 views

Delete function in solidity

There is something is wrong with my delete function or i do not know what i have missed. The id of the user is stored in both User (struct) and userIds (array) and i want to be able to delete the id ...
1
vote
1answer
55 views

Ethereum storage implementation at the database level - how is it stored

I have read the yellow paper many times as well as various articles, I suppose if I cannot find the answer here - I will look into the code. My understanding is that each contract account contains a ...
1
vote
1answer
25 views

Which node to use in Merkle Patricia Tree when there are single and shared nibbles at the same point?

If I understood well, extension and leaf nodes should be used when there are shared nibbles, and branch nodes when there are differences. Which type of node should be used when storing a different ...
1
vote
1answer
83 views

How the blocks and tries are stored

Newbie here! I still not sure if I understood how some structures of Ethereum are physically stored (assuming Geth implementation) State Trie: only one off-chain Merkle Patricia Tries stored using ...
1
vote
1answer
58 views

Blockchain storage in IoT applications

Studying about the Ethereum blockchain I realized that it is ideal for my project. I intend to develop a blockchain to exchange electric energy between consumers on a smart grid. The mining nodes of ...
1
vote
0answers
24 views

How can I create array of array contains characters with solidity

I recently approached the Smart contract two days ago. I'm still learning about it, and I have a lot of difficulties. Can you help me to create a variable like this photo? It has a arrays of numbers ...
1
vote
2answers
34 views

How accurate are Etherscan's internal tx's on Rinkeby for Oraclize calls?

I'm trying to optimize my smart contract and am breaking down where the gas is being spent. Each execution for one function costs me about $5 in gas. I looked at Etherscan and in the internal tx's it ...
1
vote
0answers
27 views

Can a blockchain such as Ethereum grow “physically” too big? [closed]

If a blockchain can be downloaded and verified by any node, wouldn't it get too big in storage size eventually? Ethereum only carries bytecode for smart contracts as additional information (please ...
1
vote
1answer
70 views

Storing Non-Transaction data on Private(or Public) Blockchain

I'm fairly new to blockchain technology and need some advice for my first application. I'm creating a dApp for Asset Tracking using a private ethereum blockchain network. I have already created the ...
0
votes
1answer
20 views

moving data from a smart contract to a local drive

is it possible to copy data from smart contract to a local drive?? ie, suppose I created a smart contract and i wish to copy the available data at the storage to my local drive... Is there any ...
1
vote
3answers
49 views

Should I use `storage` or `memory` when just reading the value and not changing state?

pragma solidity 0.4.24; contract Test { struct Book { uint id; } Book[] books; uint public status; constructor() public { books.push(Book(10)); } ...
0
votes
0answers
26 views

Problem creating struct inside a struct

Currently I am developing a game in solidity, I have 2 structs as follow: struct Team{ address owner; uint[] players; uint8[] moves; } struct Game{ Team challenger; Team ...
1
vote
0answers
30 views

How to check last block in which storage variable was modified?

I am looking for method to quick chceck in which block variable was modified last. Assuming I have geth database synced in archive mode, that means I have all previous world states tries and accounts ...
2
votes
0answers
52 views

Plasma: how were the UTXO bitmaps conceptualised and how will they be stored?

From the white paper, page 5: We construct an interactive game whereby the exiting party attests to a bitmap of participants’ ledger outputs arranged in an UTXO model which requests a ...
0
votes
0answers
18 views

Getting storage variable state by name

What do I need to make script, which given the variable name and db with storage tree, will read account storage to check the value of the variable. Can I do this only having code of contract, code ...
1
vote
0answers
23 views

Best way to restore historical storage state

What is the best way to get historical storage state, given db with current world state and blockchain data? Do I need to reverse assemby code or can I do this using receipt logs?
2
votes
0answers
52 views

What is a cheap way to store mnemonic generator list of 1024 words in smart contract?

What is the cheapest way to store a list of 1024 words for a mnemonic generator, and why? These ideas had a gas cost of 165720 GAS for a string array, and 42300 GAS for storing all the words in a ...
1
vote
1answer
28 views

Where the contract code located physically and how it can be accessed?

After deployed where the contract code physically is located at? Storage or ROM of each node? And how it can be accessed for execution? By contract address? Then, Does contract address act like a ...
1
vote
1answer
28 views

How can I get the content of storage and memory in my private chain?

I'm looking for some methods to know the content of storage and memory while the contract is running.Mayba some useful tools or abi ? By the way, the abi of geth, debug_writeMemProfile and ...
1
vote
0answers
15 views

Can Factory Contract Be Used As Parent/Child Function?

I am attempting to modify the contract below; the way it is set up at the moment is so that the contract can be deployed, and then anytime a user wants to create a campaign, they can do so without ...
2
votes
1answer
117 views

Declaring a memory array of storage pointers in Solidity

I would like to declare a variable as a memory array of pointers to storage arrays of uint256. For example: pragma solidity ^0.4.24; contract A { uint256[] public array0; uint256[] public ...
0
votes
0answers
57 views

Smart Contract - Storing 113+ byte buffer in solidity

So I am using the module (eth-ecies) in npm to perform encryption of a message offchain using the public key of my reciever, and in turn I get a 113+ byte buffer after the encryption is done. Now i ...
0
votes
1answer
21 views

What exactly is a transaction when working with SmartContracts?

I am very new in Blockchain and Ethereum. I know the has transactions and blocks with hashes etc. I also followed this example https://www.ethereum.org/greeter to create my own private Network with 2 ...
1
vote
1answer
209 views

How long do my files stay on IPFS when I upload it?

I'm trying to grasp the concept of how IPFS works. Say if I upload 1GB of data to IPFS. How long does it stay there? Or do I have to leave my computer on at all times for the file to be live on the ...
0
votes
1answer
181 views

Storing structured data in private blockchain

The task. Develop distributed registry on blockchain network that can store public data of the certain objects. For example: { "id": 123456789012345, "title": "Big black box (not more than 100 ...
0
votes
1answer
16 views

Incorrect values being passed

I am trying to copy stored values using the following internal value. pragma solidity ^0.4.21; contract test{ event LogTest( bytes32[5] a ); bytes32[5] attr; function ...
0
votes
1answer
33 views

What is the cheapest and most efficient way to send data to a struct, and why?

I'm struggling to find which way to send data to a struct is cheaper and most efficient. I came up with these 2 different styles: struct Database { string name; string addressPerson; } ...
0
votes
1answer
410 views

Where does metamask store the wallet seed? (file path)

I have a Windows installation that cannot be booted anymore. I'd like to copy the file containing the Metamask wallet seed to another machine and have that Metamask installation use it. The same ...
0
votes
1answer
160 views

Storing complex data types in Eternal Storage

I've been reading into strategies for writing upgradeable contracts. A pattern that has come up numerous times is to seperate your contracts business logic from its storage so that upgrades can occur ...
0
votes
1answer
45 views

Solidity state variable resets to default inside function

For this project, I am coding smart contracts for Ethereum using Solidity. In the following code, the variable numCertificates should initially be 1. Nonetheless, newCertificateId is 0 when assigned. ...
0
votes
0answers
55 views

Re-deployment(Upgradeable Contracts) and Inheritance Design Pattern

I am trying to design architecture along with implementation of smart contracts. I have two main problems actually, they both can be found conceptual. To make it more understandable, I will not go ...
3
votes
1answer
159 views

Mock Smart Contract For Unit Testing

I'm new to Ethereum and solidity, I'm developing a simple decentralized application using Truffle where I have an abstract contract Storage and another contract Reader which uses storage. contract ...
0
votes
2answers
97 views

Can't access nested mapping in another contract in Solidity

I have a contract: contract KeyValueStorage { mapping (address => mapping(bytes32 => uint256)) refreshTime; .... } and in another file: import "./KeyValueStorage.sol"; contract ...
3
votes
2answers
78 views

How to pop from (decrease the length of) a memory array in Solidity

I have a function that gets an address array from another contract, conditionally deletes the msg.sender from the array, then saves the new array back to that contract. Because the array backerList ...
2
votes
1answer
74 views

Always use “memory” for variables created within functions. Bad practice?

Is it bad practice to systematically use the memory keyword for variables declared within a function (other than constructor)?
0
votes
1answer
76 views

Quorum - Track State Variable Changes in Struct (Data Lineage)

I am unable to get my bytes32 variable state transition within a struct in Quorum. What I did is to I build a dashboard to loop through the blockchain to search for a particular then list out the ...
1
vote
1answer
36 views

Using the Ethereum storage for document certification [duplicate]

I am working on a Document certification platform that is based on ethereum and I wanted to know if it is possible to use the ethereum storage as a way to keep the records of documents. I know that ...
2
votes
1answer
78 views

How much data can be stored in a bytes type in a smart contract?

What are some estimates of how much data can be stored in a bytes type in a smart contract? contract test { bytes data; function storeData(bytes _data) { data = _data; } }
0
votes
1answer
71 views

Why can't I specify the storage location for integers?

According to the Solidity documentation, For almost all types, you cannot specify where they should be stored, because they are copied every time they are used. I have played around with this in ...