0
現在、ethereum dappで作業中です。私は以下のようにしっかりしたファイルを持っています。グローバルに配列要素を変更することはできません
pragma solidity ^0.4.11;
contract ArrayOfBytes32 {
address creator;
bytes32[10] bytesArray; // size must be fixed
function getArray() constant returns (bytes32[10])
{uint8 x = 0;
while(x < bytesArray.length)
{
bytesArray[x] = "myString";
x++;
}
return bytesArray;
}
function getValue(uint8 x) constant returns (bytes32)
{
return bytesArray[x];
}
}
getArray()は正しく戻ります。しかし、関数getValue()は常にデフォルト値0000000を返します。 getArray()で行った変更は反映されません!任意の溶液
ありがとうございますadam kipnis –