I am trying to get the Event data from LOG3 but the data sometimes on stack5 and sometimes on stack6, can anyone help?
for example, transfer amount = 1 of both two transfer functions, take a look at LOG3 opcode stacks.
event Transfer(address indexed from, address indexed to, uint256 value);
function transfer1(address to, uint tokens) public returns (bool success) {
emit Transfer(msg.sender, to, tokens);
return true;
}
function transfer2() public returns (bool success){
uint256 amount = 1;
emit Transfer(msg.sender, msg.sender, amount);
return true;
}
Transfer Amount data located at position 5 at LOG3 Struct Log of transfer1:
[ "0x0000000000000000000000000000000000000000000000000000000000000080", "0x0000000000000000000000000000000000000000000000000000000000000020", "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4", "0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x000000000000000000000000000000000000000000000000000000000000004e", "0x000000000000000000000000000000000000000000000000000000002e687de1" ]
Transfer Amount data located at position 6 at LOG3 Struct Log of transfer2:
[ "0x0000000000000000000000000000000000000000000000000000000000000080", "0x0000000000000000000000000000000000000000000000000000000000000020", "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4", "0x000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", "0x000000000000000000000000000000000000000000000000000000000000006a", "0x00000000000000000000000000000000000000000000000000000000a9059cbb" ]
How can I know which position to take? Thanks.
indexed
parameter, it will compile to a log1, the only topic being the event itself)