Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

Filter by
Sorted by
Tagged with
1
vote
1answer
204 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
3answers
179 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
1answer
62 views

Can you have an array of mappings? The mappings have an address key and a struct value

Can you have an array of mappings? I want to have mappings with addresses as keys and structs as the value. I want to store these addresses in an array and iterate through them. so far it looks like ...
1
vote
2answers
1k views

how does Storing and Fetching data works in Smart contracts [closed]

Please help me out with these questions. 1)Where does the contract stores the data? 2)when we access the value of a variable form of a contract, how does it retrieve the latest value? 3)how is the ...
2
votes
1answer
29 views

Problem when accessing variables in Storage geth

I found some contract that looks like this: // SPDX-License-Identifier: MIT pragma solidity 0.8.2; contract IceCream { address a; address b; bool public c = false; uint256 public d; ...
0
votes
1answer
116 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 ...
5
votes
2answers
442 views

Ethereum metadata limit

Couple of days ago Vitalik Buterin tweeted that Ethereum has no metadata limit. Is that true? Two major questions that bothers me, as a developer: I can store any amount of data inside contacts? ...
0
votes
1answer
18 views

What is better to use when querying a large but fixed number of structs - an array or a mapping?

In general, it seems as though mappings generally result in cheaper operations. What about when the number of elements are fixed (say, 20K) and setting the elements only ever occur once? Would a ...
1
vote
0answers
31 views

Saving String Memory Argument to Struct Array

I have the following Solidity code that compiles and tests okay, but the insurancePlan property of the Patient struct is not being saved. I've tried many variations and it is just blank (empty) when I ...
1
vote
0answers
12 views

What is the relationship between the size of the data saved by the smart contract and the size of the actual computer storage resource consumption?

I want to know, for example, I am passing 1KB of data to the function in the smart contract, and save the 1KB data in the smart contract through the storage variable. I want to know how much storage ...
0
votes
2answers
20 views

Push to different parts of array in Solidity

push() pushes to the back of an array. What possible solutions are there for pushing either to the front of an array, or to a specified index in an array?
0
votes
1answer
18 views

Is there any crypto that are directly linked (pegged) to a real physical commodity like gold?

Is there any crypto that are directly linked (pegged) to a real physical commodity like gold. Actual commodity held in actual real world storage somewhere.
2
votes
1answer
87 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 ...
7
votes
1answer
545 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 ...
0
votes
1answer
33 views

Want users to decide what organisations an acces their data

Im working on a concept where users can allow certain organisations to see their data. I want to store the permission on a private ethereum blockchain. I thought smart contracts would be the way to go ...
2
votes
1answer
45 views

What prevents the blockchain from being poisoned by copyrighted or illegal data?

It's possible to store data in smart contracts, and with the recent explosion of NFTs this is happening a lot. A couple of hundred kB is more than enough to encode copyrighted material - e.g. the text ...
2
votes
2answers
173 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 ...
1
vote
3answers
225 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
2answers
276 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
76 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
3answers
103 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 ?
4
votes
3answers
8k 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 ...
3
votes
1answer
349 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 ...
2
votes
1answer
30 views

Issues with extreme large solidity mapping

Is there any scalability problem if the number of items of a solidity mapping increase too much? For example, any problem when adding, changing or removing some item in the dataset? Or any other ...
0
votes
1answer
110 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
189 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
1answer
41 views

If I pass an enum as a parameter does it get stored in the blockchain?

I'm developing a Rock/Paper/Scissors Smart Contract (with a Commit-Reveal scheme). I have this enum: enum Move {rock, paper, scissors} I want to pass it to a function, without storing it to the ...
0
votes
0answers
14 views

Why do you always have to declare the “memory” keyword for strings inside a function? [duplicate]

Example: function myfunc (string memory words) public returns (string memory) { XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX } Why is it compulsory to declare the "memory" keyword? Would the ...
0
votes
0answers
17 views

In Solidity, Modifiers & Mapping variable are stored where - storage or memory?

In Solidity, Modifiers & Mapping variable are stored where - storage or memory ?
0
votes
1answer
37 views

Is there any way to find out what exchange a ETH wallet was created?

I added a ETH wallet address to Genesis Mining back in 2017 for a 2 year contract. After the contract was finished it still took them a year to add the ETH to said Wallet. (long story but I did not ...
3
votes
3answers
1k 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 ...
0
votes
1answer
79 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 ...
1
vote
1answer
225 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 ...
8
votes
3answers
9k views

How to initialize an empty array inside a struct?

Is there a mistake in the way I initialize Bar b in the function foobar? contract Foo { struct Bar { address owner; uint[] x; } Bar[] public bars; function foobar(...
0
votes
0answers
22 views

How many key-value entries can be stored in Solidity Mapping data structure?

mapping(uint => uint) public myMap; function store(uint key, uint val) public { myMap[key]=val; } function retrieve(uint key) public view returns (uint){ return myMap[key]; } Considering ...
1
vote
1answer
490 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
1answer
20 views

Where is the data of a transaction saved?

To introduce my question I would like to give an example. Suppose a customer wants to join a gym. A transaction is sent and contains: customer id name and surname start date end date The smart ...
36
votes
3answers
10k views

Difference between Memory and Storage?

What is the difference between Memory and Storage ? From both the EVM point of view and the contract design one. Thanks!
0
votes
1answer
102 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 ...
1
vote
0answers
30 views

How to initialize storage for smart contracts in the genesis block

I have a simple smart contract that will be added as part of genesis block. Need to initialize the field "message" with default value as constructor is not executed as part of genesis block ...
0
votes
1answer
109 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
1k 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
1answer
36 views

Do parts of decentralised apps take advantage of centralisation?

So, obviously MetaMask interacts with public, distributed ledgers in order to show my balances, however, from a technical perspective, do certain parts of the application use centralised databases? ...
3
votes
1answer
719 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 ...
3
votes
2answers
36 views

Set and delete storage variable in same tx

I did some poking around and didn't see an answer... and I figure someone knows this off the top of their head. Question: what is the gas cost associated with setting and deleting a storage variable ...
0
votes
1answer
68 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 ...
0
votes
0answers
23 views

How store memory array in storage

In this code, I want to send an array of bytes32 and store them in the struct but I get the error which is TypeError: Type string memory[8] memory is not implicitly convertible to expected type ...
17
votes
3answers
18k 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
0answers
27 views

Does delegatecall() use only the calling function?

Let me explain with the code: contract A { function f() public { [...] g(); } function g() private { [...] } } contract B { A a; function delegateA() public { (bool success, ) = address(...
1
vote
1answer
51 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.

1
2 3 4 5
9