Questions tagged [state-variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
3answers
4k views

How to get the cost (in gas) of the non-constant function call?

In my understanding, there are some situations, where the compiler can't calculate, how much Gas it takes to complete the function call. The most obvious example - when your function is calling some ...
11
votes
2answers
8k views

Local variable and state variable, and the difference between them

I am new to solidity. When I read the solidity documentation, it says local variable and state variable. But I can't find the definition of the two terms. Can anyone explain the meaning of local ...
0
votes
0answers
628 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(...
2
votes
1answer
537 views

Local storage variable

I am reading the solidity docs here and I seem to be struggling to understand the following. Data locations are important because they change how assignments behave: assignments between ...
1
vote
0answers
76 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/...
1
vote
1answer
164 views

Function doesn't change change variable's value

I have made a contract with a struct, Stock. I have an array with two such Stocks. They can be initialized fine, but when I try to change the value of a variable nothing happens. Also, the same ...
1
vote
2answers
201 views

Not able to read data from smart contracts

I am doing PoC on Ethereum using Azure Ethereum network and Web3. I was working from last 1 month and I have created one smart contract for student management and that was working like fab. But for ...

1
2