Stack Exchange Network

Stack Exchange network consists of 175 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 [state-variable]

The tag has no usage guidance.

2
votes
2answers
95 views

Is Solidity creating an implicit getter for a nested contract that is created?

Is Solidity creating an implicit getter or not for a nested contract that is created? Example: contract Foo { .... } contract Bar { Foo public foo; Bar() { foo = new Foo(); } ...
0
votes
2answers
26 views

Accessing private variables using assembly

I would like program an oracle service which I would like to charge a fee for. Therefore, I would store the data of interest as a private variable in my oracle contract. This private variable should ...
4
votes
1answer
155 views

What are 'payable' state variables?

https://solidity.readthedocs.io/en/latest/solidity-by-example.html#simple-open-auction pragma solidity ^0.4.22; contract SimpleAuction { address payable public beneficiary; What exactly does ...
2
votes
1answer
246 views

Why public variables aren't able to implement interface functions?

I'm curious why interfaces don't accept public variables as implementations, since public variables have getter functions generated for them. For example why couldn't the ERC20 balanceOf interface ...
1
vote
1answer
17 views

Accessing the Ethereum State Variables using web3js (Java Script)

I'm trying to run the below code to get the state variables using the getIdBytes method of the Smart Contract, and assign it to a java script array variable, but it doesn't seem to work. All I can ...
0
votes
1answer
51 views

Unable to change the length of a global 2D storage array

I am facing difficulties changing the length of a global 2D storage array. It seems to be working correctly on Remix IDE, but when I try to test it on ganache-cli (formerly known as testrpc) - either ...
1
vote
0answers
26 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?
1
vote
0answers
59 views

Layout of State Variables in Storage -> specifically NON Statically-sized variables e.g. Mapping

The following page provides information on how to access a contract's state variables, regardless of who the owner is or what methods are exposed. http://solidity.readthedocs.io/en/latest/...
0
votes
0answers
23 views

How the default block in Parity is set

How function setting default block (going back in history) in parity is implemented looking from algorthmic side?
0
votes
0answers
23 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 ...
0
votes
0answers
113 views

How to call a public getter programmatically on web3?

I have used the following code successfully: contractInstance.PublicStateVariable.call((e, r) => { if(e) { //handle the error } else { //handle the response } }); Let'...
0
votes
0answers
37 views

Can we issue a token with specific local state?

Will it be possible to create an ERC20-Token, that will be "minted" with specific local state on a per token-basis while this state can change over time through the execution of a method in the smart ...
0
votes
0answers
87 views

How to interact with a smart contract to change a variable state

How do I change a variable in a smartcontract (bool) As requested, a new followup question from the above^ about ethereum smart contracts (solidity) If I have, early in the contract: bool public ...
0
votes
0answers
546 views

totalSupply in ERC20Basic contract is not initialized to zero. Does that matter?

I copied code from TenX, which copied code from OpenZeppelin. TenX and OpenZeppelin has this code for contract ERC20Basic: contract ERC20Basic { uint256 public totalSupply; function balanceOf(...