near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.32k stars 619 forks source link

Support Hardhat's console.log() precompile #3696

Open artob opened 3 years ago

artob commented 3 years ago

As discussed on the 2020-12-03 sync, a useful EVM extension-in terms of offering the best possible developer experience-could be support for Hardhat's [console.log()](https://hardhat.org/hardhat-network/#console-log) facility, one of the compelling features that is driving Hardhat (formerly Buidler) adoption:

Buidler gives you a console.log for your contracts which is a game changer. – [Migrating from Truffle to Buidler](https://soliditydeveloper.com/truffle-to-buidler)

This overloaded Solidity function simply [invokes a Hardhat-specific precompile](https://github.com/nomiclabs/hardhat/blob/master/packages/hardhat-core/console.sol), which the [Hardhat Network](https://hardhat.org/hardhat-network/) runner intercepts and provides terminal output for. Simple, but most essential for facilitating a rapid development cycle.

The ability to get useful output also from contracts deployed to testnet and mainnet would be invaluable for Solidity developers. Support for this precompile should be straightforward to implement in our OpenEthereum fork, and could be behind a feature flag so that the patch could conceivably be upstreamed.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.