Created
June 19, 2017 21:38
-
-
Save vwvw/0f76a0ae475d88b28a90e4cb2dfcc9b3 to your computer and use it in GitHub Desktop.
This seems like a problem in solidity. PrintUint print number ascending from 1 to 4, instead of 1, 1, 2, 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract test { | |
event PrintUint(uint256 _value); | |
function testA() { | |
uint256 x = 5; | |
uint256[] A; | |
uint256[] B; | |
for(uint256 i = 0; i < 2; i++) { | |
A.push(i); | |
PrintUint(A.length); | |
B.push(0); | |
PrintUint(A.length); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If somebody found this: here is the solution: https://gitter.im/ethereum/solidity?at=59484e8c6462d8493c2c7a00
Declare variable in memory, local variable in storage is messy.