Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

Filter by
Sorted by
Tagged with
2
votes
3answers
259 views

Decentralized database for ethereum?

I'm looking for a way to store data in a decentralized way such that I can access any record from within the smart contract, probably through oracles I guess? I've been looking into gundb but not ...
1
vote
2answers
51 views

How do programs on the 'Ethereum World Computer' compare to traditional programs or websites?

So this question has been bugging for me for a while and I can't seem to find the answer to it. Context I have been a web developer for many years. When I access a website, any frontend code is run ...
1
vote
1answer
23 views

Storage Address of Smart Contract Variables

I'm working on EVM (and more specific on hyperledger besu ethereum client) to make smart contracts more secure (by detecting and reverting malicious transactions). I need to know storage address of ...
0
votes
1answer
97 views

Switched from the Ethereum Wallet's test network to main network and need to remove the previous data

I was on the Ethereum Wallet's test network and finally worked out all the code, but now that I have switched over to the main network I've had to download a lot of the preexisting blocks and has my ...
1
vote
1answer
188 views

Looking for help with designing a private Ethereum blockchain to store information

I would like to be able to store a history of an object on a private chain and have it update-able via a website.It needs to hold public information and some hashed links to an external database. Just ...
0
votes
0answers
14 views

Clarification on how Calldata persists on the blockchain and how Optimistic Rollups use it

So I see that a lot of optimistic rollup solutions say that they store the chain's transaction data on Ethereum via "calldata" which is way cheaper in gas costs than contract storage (I ...
0
votes
0answers
16 views

Storing Struct inside an array. Help Please

I am designing an EHR System that will store patient records (with a unique ID) and separated by the date and Hospital entered. I am able to enter data in Hospital struct mapping to the Record struct, ...
3
votes
3answers
845 views

How to handle dynamic size string array in solidity?

I have a shop owner and a shop owner can have multiple products. I want to keep the products id in an array. Also, A public method can return all the product id list of a shop owner. I tried the ...
6
votes
1answer
256 views

What filesystem should I use for geth and leveldb?

I used old LGA775 machine for running geth node. Its mobo has older sata 3gb/s (benchmark showed that ssd bottlenecked there) and only 4gb of DDR2, with windows installed. So syncing is a real pain ...
1
vote
3answers
120 views

Can the mapping storage change after contract deployment?

I am beginner in mapping.I work on Truffle and Ganache. I deploy the following contract: pragma solidity ^0.5.12; contract customerFinder{ mapping(uint256 => address payable) public ...
1
vote
1answer
384 views

Where do you save the application data of a Dapp?

Let's say that I want to implement a Dapp similar to Facebook. Each user has its own profile, pictures and information. Usually you would use a database to store all this data. This guarantees that ...
0
votes
2answers
276 views

What is the proper pattern to use a temporary variable and ensure it gets stored?

A contract has a state variable, which is complex. For the example, lets say it is a mapping of structs. Inside a method, I want to access that and store the changes. Like so: contract FooManager { ...
0
votes
1answer
71 views

Data storage and replication in a private blockchain

What type of data is Ethereum storing (file? data row in DB)? Where does it put it (theoreticaly it is stored in peers, does this mean every node must have a local db)? How the peers of the p2p ...
0
votes
1answer
47 views

When and where do I set ERC721 tokens' data?

I am currently working on a smart contract to sell ERC721 tokens. I understand that my code should have a function that allows me (the owner) to mint a token and add it to a list which stores all the ...
0
votes
1answer
89 views

Associate event struct to user addresses

I have two contracts. One called User and other called Event pragma solidity ^0.4.24; contract User { mapping(uint=>address) addresses; uint addressRegistryCount; } pragma solidity ^...
4
votes
1answer
670 views

Reset all values in a mapping

I am trying to figure out how to have the balance of all players reset to (amount) when a certain condition happens. This is the function that will update a specific player balance. How do I make it ...
0
votes
0answers
21 views

Making sure a string (input/output) is less then 64 characters

I'm working though some basic solidity tutorials using remix. I'm having trouble with the concept that there is no way to edit a string built into the language. In other programing languages I would ...
3
votes
1answer
708 views

Regarding external file storage

Let's say you have a private blockchain, a DApp with an workflow to store and retrieve data from that blockchain. Now there is a need to store binary files and access it in a permissible way. One way ...
0
votes
1answer
81 views

How to get data location for string > 31 length

The documentation says: bytes and string are encoded identically. For byte arrays that store data which is 32 or more bytes long, the main slot stores length * 2 + 1 and the data is stored as usual ...
0
votes
1answer
48 views

pass storage through interface to library

Here is what am i doing: There is a library, accept storage argument as parameter, then do some math and return the result. And there is a contract to call the function in the library, and an extra ...
1
vote
1answer
47 views

How the data management is done in Ethereum blockchain?

Anyone who have a good idea about ethereum blockchain storage can send me some docs to get a good idea for myself? i am in a full confused state.
0
votes
1answer
47 views

Calling a function to zero out struct data in a mapping costing more gas than other calls, causing out of gas error

I am working with the following function and state vars: struct TimeRestriction { uint256 fromTime; uint256 toTime; } mapping (address => TimeRestriction) public whitelist; function ...
0
votes
1answer
42 views

Ethereum Smartcontracts with YottaChain

I am very much curious about this new storage system YottaChain. Can someone point me good articles/videos/sources as a reference to go through and understand its implementation with ethereum smart-...
0
votes
3answers
163 views

New temporary struct causing state variables to be overwritten

I'm running an experiment where I'm trying to create the following behavior: Service owner deploys Experiment1 to the blockchain and is recorded as the owner. Owner then adds a user address, a user-...
0
votes
0answers
15 views

Performance of Dapps when millions of records to be fetched

I am thinking of Dapp with react js and ethereum. Using IPFS for data storage. Let's assume that blockchain holds millions of hash addresses from IPFS. I need to show those millions of records and ...
0
votes
0answers
18 views

Type struct Mycontract.User memory is not implicitly convertible to expected type struct Mycontract.User storage pointer

pragma solidity >=0.5.0 <0.7.0; contract Mycontract{ uint256 a; struct User { string name; } User[] users; function foo() public{ **User storage user=User("hey&...
0
votes
1answer
28 views

The below code gets compiled but when foo is called invalid opcode error is thrown

pragma solidity >=0.5.0 <0.7.0; contract Mycontract{ uint256 a; struct User { string name; } User[] users; function foo() public{ User storage user=users[0]; ...
0
votes
1answer
25 views

why x(function setArr) is not being returned?

pragma solidity >=0.5.0 <0.7.0; contract Example{ uint256[3] x; function setArr(uint256[3] memory y) public returns(uint256[3] memory){ x=y; return getArr(x); } ...
0
votes
1answer
18 views

Understanding data location

pragma solidity ^0.5.16; contract mycontract{ uint256 public a; function foo(string calldata _name) external { string memory names; names = _name; getname(names); ...
0
votes
1answer
76 views

How to store and encrypt Keys?

I am developing chrome extension like metamask for the private Chain. I have generated the keys and using localStorage to store the Keys. But I am not sure whether I am going correct or not for ...
0
votes
1answer
18 views

DeclarationError: Uninitialized storage pointer. Struct error when running truffle tests

I've seen other similar questions but they don't explain why this error happens and/or they are case specific questions. So, I have this code: pragma solidity >=0.4.22 <0.7.0; contract ...
47
votes
5answers
24k views

What is the cost to store 1KB, 10KB, 100KB worth of data into the ethereum blockchain?

Whatever is stored in the blockchain is immutable which means I can fetch this data back in the future. As of today (2016-feb), How does one store a 1kb, 10kb, or 100kb or arbitary data/text in the ...
0
votes
1answer
41 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
1answer
33 views

DApp Development- how to update dapp and keep existing data

Compare to web application that separate the application and database, we can update the application and keep the existing data. Could you suggest me how to update dapp and keep the existing data?
0
votes
1answer
29 views

can't get struct in return

I am trying to execute unit tests for a solidity smart contract: I have: mapping (bytes16=>Device) public Device_Table struct Device { bytes16 UUID; bytes16 hardware_UUID; string ...
14
votes
3answers
14k views

TypeError: Data location must be “storage” or “memory” for parameter in function, but none was given

/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param ...
0
votes
1answer
27 views

Issue with dynamic matrices in solidity

I have a matrix in solidity like that string x[][] I'm trying to write functions to return rows and colums The following code works well: // SPDX-License-Identifier: unlicensed pragma solidity ^0.6.0; ...
2
votes
1answer
84 views

Decentralized Data Storage for IoT using Sia

For my Master research I want to make a proof-of-concept of decentralized data storage for an IoT scenario. My idea is to receive measurement values from a raspberry pi and to store them using sia. I ...
0
votes
1answer
35 views

Storing name values off-chain in events and web3.js

Somewhere I read the advice to store name (title, geographical name, people name, etc.) value off-chain in events. But if a value is stored in an event, is there an efficient way to retrieve its ...
2
votes
2answers
149 views

Possible to search swarm or blockchain?

I'm getting my feet wet in this blockchain world and looking to build a dapp based on Ethereum for maintaining an inventory of products. About 400,000 items that can be updated, removed or added to by ...
0
votes
1answer
21 views

When using mapping, why use an address over bytes32?

From an end user standpoint, they will never want to use the address for searching for mapped data when they could just submit a username for function parameters, so is there any specific reason why ...
1
vote
2answers
235 views

How can I persist an assignment to a struct in a mapping?

The following is a simplification of the problem I'm facing; pragma solidity 0.4.18; contract ValueSetter { struct BasicValue { uint256 value; } address my_address; // Just for the ...
3
votes
1answer
75 views

CALL always throws exception on SSTORE

this.call(bytes4(keccak256("setGBA(uint32)")), 12); How to call function by string name? I can't modify store in function. How to do this?
0
votes
1answer
27 views

Passing storage of one library to another library

I have two libraries: A and B as well as contract C using them. Library B, in one of its functions, needs to call a couple of functions defined for A.Storage. The code below compiles, tests are ...
0
votes
0answers
12 views

Data storage : mapping vs sub contract deployment

I read over few website, tutorials and answered question here on SE. There is a huge warning about deploying new contract just to store datas. i.e. : bad uint256 public amount; bool public isAdmin;...
3
votes
1answer
92 views

How to download the blockchain of a single ethereum contract’s address?

The blockchain required to run ethereum is several Terabytes large. This means more than 9 years would be required to download it with my connection speed. In my case, I just want to know if the ...
0
votes
0answers
35 views

Storing data directly on chain

Im trying to store data directly on the blockchain, not on a smartcountract as they have a limit of what they can handle and it would slow down the chain to go above the limit. My initial plan is to ...
2
votes
3answers
709 views

ERP systems and Ethereum

I wanted to know the integration state of ERP system (like SAP) and Ethereum. Is there an API that allow a smart contract to fetch information from a ERP to store that data? Thanks in advance Best!
1
vote
1answer
430 views

Unexpected behavior with storage keyword?

Could someone explain to me what exactly happens when I declare a storage pointer? This example highlights the issue that I have encountered: contract minimum { uint256[] a = [1,2,3,4]; function ...
0
votes
3answers
75 views

Alphanumeric ranking of adresses

How is it possible in an ethereum contract to sort the public adresses of senders of eth in the contract in the alphanumeric order ?

1
2 3 4 5
9