dapphub / dapphub/dapptools

hevm: decode ds-note events

Open
#93 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
2.1k
Forks
320
PR merge metrics
No merged PRs in 30d

Description

[ds-note](https://github.com/dapphub/ds-note) emits anonymous events, which show up in the trace output as

```
├╴ 0x... [data] ... (src/note.sol:39)
```

where `[data]` is the binary from the (un-indexed) event args. This data includes the full calldata, which could be decoded and shown, given that the first argument to the `note` event is `msg.sig`, allowing the function abi to be looked up in the `abiMap`.

```
event LogNote(bytes4 indexed, address indexed, bytes32 indexed, bytes32 indexed, uint256, bytes) anonymous;

modifier note {
bytes32 foo;
bytes32 bar;
uint256 wad;

assembly {
foo := calldataload(4)
bar := calldataload(36)
wad := callvalue
}

emit LogNote(msg.sig, msg.sender, foo, bar, wad, msg.data);

_;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.