2

I wanted to get the details of the following transaction hash : https://ropsten.etherscan.io/tx/0x8b43cf5e2c9d4eabb1121036de3d60354f64e9ccc6004caccba0e478c50ed2e6. And Ropsten has got an API to get the event details. The event that i am implementing is in sendBounty() (minting tokens):

function sendBounty(address _to, uint256 _tokens) returns (bool) {

        require(_tokens + bountyCount  < MAX_Bounty_Tokens );
        bountyCount= bountyCount+_tokens;
        mint(_to,_tokens);

    }

function mint(address _to, uint256 _amount) public canMint returns (bool){
        totalSupply_ = totalSupply_.add(_amount);
        balances[_to] = balances[_to].add(_amount);
        emit Mint(_to, _amount);
        emit Transfer(address(0), _to, _amount);
        return true;
   }

The API that i wanted to use is https://ropsten.etherscan.io/apis#logs

I am unable to understand the terms topic0, topic1, topic2, topic3 and how to use it. Requesting Help and thanking in advance :)

1

1 Answer 1

1

The topics array of a log is the list of parameters to the event that the log represents with the first topic being the event identifier. Basically you have to use the contract ABI to translate the log into a readable event. As stated in Olivers's comment Using Event API of Ropsten, this answer pretty much nails the details: https://ethereum.stackexchange.com/a/12951/48513

You could use https://github.com/ConsenSys/abi-decoder for decoding the logs yourself.

If you don't want to go though that hassle, you could have a look at https://eth.events (shameless plug, I'm the CTO) and just search for the translated event :-)

0

Your Answer

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

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