1

As you can see below, the indexed field is ignored, and the last field is set to zero:

contract MyContract {
    event MyWorkingEvent(
        address thing4,
        address thing5,
        address thing6);

    event MyBrokenEvent(
        address indexed thing1,
        address thing2,
        address thing3);

    function logAllTheThings(){
        MyWorkingEvent(0x12, 0x34, 0x56); // works :)
        //output => MyWorkingEvent["0x12","0x34","0x56","0x78"]

        MyBrokenEvent(0x12, 0x34, 0x56); // doesnt work :( 
        //output  => MyBrokenEvent["0x34","0x56","0x78","0x0"]
    }
}

I'm testing all this from browser-solidity

  • Can you provide more details about how you're testing this? I tried copying your code into browser-solidity and got a bunch of errors saying events aren't supported at this time. – ryepdx Jul 28 '16 at 19:10
  • It works for me. You are probably on an older version. Let me know if it works for you here: ethereum.github.io/browser-solidity/#version=soljson-latest.js – ZMitton Jul 28 '16 at 19:13
1

This appears to be a bug in browser-solidity. I went ahead and deployed your contract using Mist and was able to trigger the events and see the values just fine.

working events in Mist

  • 1
    Thanks ryepdx. @zachferland found that is also works fine in truffle. I'll submit the issue to the browser-solidity people on github. – ZMitton Jul 28 '16 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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