NomicFoundation / hardhat-ignition

Hardhat Ignition is a declarative deployment system that enables you to deploy your smart contracts without navigating the mechanics of the deployment process.
https://hardhat.org/ignition
MIT License
108 stars 26 forks source link

Add a way of visualizing transaction history #804

Closed tmigone closed 2 months ago

tmigone commented 2 months ago

Describe the feature

Problem

Sometimes it's useful to have a human readable way of visualizing the "transaction log history" for a deployment.

Solution

In conversation with @alcuadrado he mentioned a good solution to avoid having to duplicate the data would be to add a subcommand to hardhat ignition that would parse the journal files and log to console the relevant bits. This new command could allow filtering the data based on the outputs but also it could be piped to a file or other unix tools for further processing.

In our case the data we would be interested in is:

As an example, this is what our custom deployment system logs when running a deployment:

[2024-09-09T19:44:26.629Z] > Deploying contract: GraphProxy
[2024-09-09T19:44:26.629Z]    = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E
[2024-09-09T19:44:26.629Z]    = Params: [ 0xa2E3Aae2D21ee91F6Eeba955bc228513F452b328,0x34720e631A2C63E50b0B01f3DF4E94B21A24B6DC ]
[2024-09-09T19:44:26.629Z]    = TxHash: 0xffaa55ca48d9d00363d6d5405a97e9d71456ef9fbbd83332716ba82938f3576c
[2024-09-09T19:44:26.630Z]    = CreationCodeHash: 0x4e89f2d508c7fb36a48a2791a7dc187233ad7fec009ca84f1416a4aa648640af
[2024-09-09T19:44:26.630Z]    = RuntimeCodeHash: 0xea92401f476b5d9e7863f829cb1409d3b395c839cbf9e07286dd608ae129901b
[2024-09-09T19:44:26.630Z]    ✔ Transaction succeeded!
[2024-09-09T19:44:26.761Z] > Deploying contract: AllocationExchange
[2024-09-09T19:44:26.761Z]    = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E
[2024-09-09T19:44:26.761Z]    = Params: [ 0xd23eD7B05448F007d7C810F48bd5fB363531E61a,0xef63884e6122af92030CE0fE18f732c826eB261a,0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9,0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d ]
[2024-09-09T19:44:26.761Z]    = TxHash: 0x918ce0dccf08d49836b8a013f9e9fd7f4f08b2958f2dd162dd9b06e4e844298e
[2024-09-09T19:44:26.763Z]    = CreationCodeHash: 0x3600c15b83507622be9f21892e1c183297542605c45bacdf03b2fa85ac59bba6
[2024-09-09T19:44:26.763Z]    = RuntimeCodeHash: 0x73b2c6034c03ed9b96ae6b64ad843ed55c9c33e6c4df1d321d1991e03c49a539
[2024-09-09T19:44:26.763Z]    ✔ Transaction succeeded!
...
[2024-09-09T19:44:26.775Z] > Sending transaction: GraphProxyAdmin.transferOwnership
[2024-09-09T19:44:26.775Z]    = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E
[2024-09-09T19:44:26.775Z]    = Contract: 0x34720e631A2C63E50b0B01f3DF4E94B21A24B6DC
[2024-09-09T19:44:26.775Z]    = Params: [ 0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b ]
[2024-09-09T19:44:26.775Z]    = TxHash: 0x54fe5338b2c5cd1869f4beb3ad554549a80ef6314ea8dc0569a5a81721eb3128
[2024-09-09T19:44:26.775Z]    ✔ Transaction succeeded!
[2024-09-09T19:44:26.785Z] > Sending transaction: Controller.setContractProxy
[2024-09-09T19:44:26.785Z]    = Sender: 0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E
[2024-09-09T19:44:26.785Z]    = Contract: 0x81e2b9f4e408c2A0417CCE7eBecCB3aeDd4603E2
[2024-09-09T19:44:26.785Z]    = Params: [ 0xe6876326c1291dfcbbd3864a6816d698cd591defc7aa2153d7f9c4c04016c89f,0xe2517eead1Bb7a34908336e6769a969C23535Ec7 ]
[2024-09-09T19:44:26.785Z]    = TxHash: 0x7431cd26284022f4eeb5bc5d048d27c7b13a628030080117aa5bed7e6d187224
[2024-09-09T19:44:26.786Z]    ✔ Transaction succeeded!

Search terms

journal, log

tmigone commented 2 months ago

Duplicate of #805