Simple contract, one function.
function getSha256(uint32 nonce) returns (bytes32 hash) {
return sha256(nonce);
}
> contractInstance.getSha256.call(1);
Error: Error: VM Exception while executing eth_call: stack underflow
Simple contract, one function.
function getSha256(uint32 nonce) returns (bytes32 hash) {
return sha256(nonce);
}
> contractInstance.getSha256.call(1);
Error: Error: VM Exception while executing eth_call: stack underflow
Try adding the constant
modifier as follows:
pragma solidity ^0.4.10;
contract Test {
function getSha256(uint32 nonce) constant returns (bytes32 hash) {
return sha256(nonce);
}
}
And here is the Remix screen showing that it works:
If you don't add the constant
modifier, you will have to execute your call as a transaction.
See What is the difference between a transaction and a call? for further information.