zemse / hardhat-tracer

🕵️ allows you to see internal calls, events and storage operations in the console
MIT License
355 stars 36 forks source link

Adds math opcodes #80

Open 3commascapital opened 3 months ago

3commascapital commented 3 months ago

These changes print out math opcodes that take 2 inputs and push its result to the top of the stack. The list of operators and appropriate typing can be found in math2.ts. I found that it was a cleaner diff to break the switch pattern being used in opcodes/index.ts but I am willing to use it if required. I plan to add the 3 input opcodes as well. Happy to do these changes in pieces if desired.

3commascapital commented 2 months ago

I think the main thing to discuss is the coerceMathOperations variable. currently i am hard coding it. however, this could be turned into some sort of strategy configuration from the user. I am thinking about the following for this input:

3commascapital commented 2 months ago

any thoughts @zemse ?

zemse commented 2 months ago

Sorry for the delay, I'll try to review this sooner.