ApeWorX / ApeWorX/web3.py

console.log support

Open
#3,201 1 comment 0 reactions 0 assignees View on GitHub
priority: p3 nice to have
Dominant language
Python
Stars
5.5k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
2

Description

### What was wrong?

Currently some EVM backends, namely Foundry and Hardhat offer [console.log](https://book.getfoundry.sh/reference/forge-std/console-log) integration.

- console.log is what the name says, written in Solidity - it outputs specific emits that can be interpreted as a debug log
- as a special rule, console.log events regardless if the transaction reverts or not
- AFAIK console.log on Hardhat and Foundry are compatible, not sure if Ape/Vyper have equivalents

Currently web3.py does not support console.log, but this is **extremely** useful feature for developers who work with smart contract development.

### How can it be fixed?

- Figure out how console.log does it magic trick of emitting events despite the transaction fails
- Add a web3.py module to deal with console emitted output
- Add a middleware that can transform console.log output to Python logging
- Write a docs mini tutorial explaining how the feature is supposed to used by developers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.