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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

all questions regarding data and storage on the ethereum blockchain

0
votes
1answer
17 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
38 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
22 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 ...
0
votes
0answers
21 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 ...
1
vote
0answers
21 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
13 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
19 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
47 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
19 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
19 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
11 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
41 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
34 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
73 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
66 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
15 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
32 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
145 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
87 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
31 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
35 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
78 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
52 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
64 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
26 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
53 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
26 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
40 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
34 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 ...
1
vote
2answers
129 views

MongoDB vs Ethereum Swarm

I am designing a DAPP. I have two options available for storage MongoDB OR Ethereum swarm(OR IPFS). As MongoDB also replicates data to multiple shards fault tolerance is available in MongoDB. What ...
0
votes
1answer
37 views

how to replace an array in a mapping?

I'm learning solidity right now and making a dApp where users get paid to perform actions. Actions are paid based on certain criteria. Since I can't schedule a cron job on ethereum, I can only pay ...
1
vote
2answers
1k views

Why cryptokitties uses storage instead of memory?

There are a lot of explainations of storage and memory out there like this question or this question. But I'm wondering why cryptokitties for example uses storage instead of memory in many functions. ...
1
vote
1answer
68 views

Using a library to change storage

I'm trying to learn about using libraries in solidity. In the following test contract, swapNumberLib does not successfully set value1 = value2. I thought libraries could act on the storage of a ...
0
votes
0answers
11 views

How much storage does a deployed contract use and how can I show this [duplicate]

I am trying to show the storage used by a smart contractb that I have previously deployed, let contractAddress = '0xf1f5896ace3a78c347eb7eab503450bc93bd0c3b' for (index = 0; index < 10; index++){ ...
1
vote
0answers
65 views

How to derive the storage key of mapping to an account?

I am trying to derive changes of account storage by mapping accounts (here, the accounts represent the key address in the ERC20 balances mapping mapping(address => uint256)) to their corresponding ...
5
votes
3answers
889 views

Blockchain password manager

Is there a blockchain, or a smart contract designed to store user passwords? I am using a proprietary password manager and have hundreds of passwords stored there. I am just a bit worried that the ...
0
votes
1answer
98 views

Transaction's data vs Smart contract's data

with reference to this question. Store specific data related to users I wanted to ask is there any difference between transaction's data and smart contract's data? how is transaction's data is ...
0
votes
0answers
20 views

How much storage does a smart contract use

I am trying to show the storage used by a deployed smart contract, I have a piece of code here that shows the first 10 indexes, let contractAddress = '0xf1f5896ace3a78c347eb7eab503450bc93bd0c3b' for (...
1
vote
1answer
27 views

Is the uint “ID” in this function saved in storage?

I am a bit confused about the uint "id" in the start function. I understand that the uint "nextCampaignId" is a global variable, and so changes made to it will be saved in storage; which means that ...
1
vote
3answers
65 views

Reading storage from another contract [duplicate]

Is it possible to read any storage spot in a contract from another contract in EVM? I don't care if it is hackish or not. My guts say that's not possible because it makes it possible to read internal ...
1
vote
2answers
31 views

value types(uint, bool, etc) as local variable is set to memory initially?

According to this answer, it says simpler variables like bool, uint, et cetera are not variable in length, and are therefore defaulted to memory, whereas this one mentions uint256 v; is default to ...
1
vote
2answers
73 views

Storing a document with multiple large video files

What's the best way to store a document with multiple large video and CAD files on Ethereum. I am just a beginner to Ethereum. The document is a science experiment with multiple documents linked. I'd ...
2
votes
0answers
78 views

Decentralized File Storage on Ethereum white paper

I am reading white paper of Ethereum, and I am confused by this example of the Section. Decentralized File Storage, which is part of the Section. Applications: The key underpinning piece of such a ...
0
votes
0answers
23 views

Querying large amount of contracts

I use blockchain to have immutable persisted history about all changes. But the problem is that I'm not able to efficiently query this data. For example, this is my current code: function ...
0
votes
0answers
32 views

Reporting for blockchain data

Currently reports are queried from data warehouses(OLAP) and not from transactional databases(OLTP). Data in transactional databases is processed using ETL(Extract,Transform,Load) operations and then ...
0
votes
1answer
42 views

Why lot of Smart Contract implementations are using a single instance to hold all accounts?

I found a lot of example of tokens (like ERC20) using this pattern: contract MyCoin { mapping (address => uint) balanceOf; ... } Those contracts are deployed once, the "balanceOf" ...
2
votes
1answer
45 views

How are storage pointers implemented in the EVM layer?

I'm trying to understand how storage pointers work. From looking at the ethereumjs-vm implementation it seems that the actual value is returned from SLOAD. Does the compiler handle the 'pointer' ...
1
vote
1answer
37 views

Why does creating an array in storage within a method change the state for something else?

I have a simple contract that sets an owner when the contract is initialized, but am having trouble understanding why it changes under certain circumstances. I tried 3 ways of initializing and ...
0
votes
0answers
20 views

how can I initialized bytes1 array? is there maximum size to do that?

I want to initialize bytes1 array as follows, function myData(bytes1[10] _inData) public pure { bytes1[100] memory myCData = [ bytes1(0x01), 0x02, ......so on.. till 100 ]; } But I got out of ...