I have written the below code and it runs perfectly. After mining and passing the values along with certain gas value, i get transaction hash as output on the geth console. Now i want to know the output of sha3 function applied in the code?

contract C { 
string a;
string b;
bytes32 d;

function identify(string sm, string bm, bytes32 i) returns (bytes32 hash){
    a = sm;
    b =bm;
    d = i;
    return sha3(sm, bm, i);


Once mining is done. i type the following command:


I get the transaction has i.e

Contract mined! address: 0x1df37eeccc9278b04497b4a3c97388cac3a98e6f    
ash: 0x7bf49540c9db92cab84b483514ffebdb600d39889ef2319904bc788d7c87afd9

Now, where is the output of the sha3 function?

2 Answers 2


Some options, explicitly label the function constant:

function identify(string sm, string bm, bytes32 i) constant returns (bytes32 hash)

or explicitly perform a call:


I tested in browser-solidity and you should see the value 0xc479d062d8322fb8b4207d9967174220d6d86d90fef3b5c6cefc8ec6577e21c8.

More info: What is the difference between a transaction and a call?


The return value of a contract call is ignored unless the call is from another contract. The yellow paper has the following sentences:

Aside from evaluating to a new state and transaction substate, message calls also have an extra component---the output data denoted by the byte array $\mathbf{o}$. This is ignored when executing transactions, however message calls can be initiated due to VM-code execution and in this case this information is used.

If you record an event in Solidity, the event logs are visible in the transaction receipt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.