-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use custom errors to optimize gas costs #73
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM
1fe9073
to
84278e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks! Today I learned about custom errors in Solidity :)
@markspanbroek can you elaborate on this? Is there anything in particular Custom errors in solidity are just the first 4 bytes of their For |
Currently it forwards error strings that it gets from a json-rpc call to an ethereum node. I haven't checked whether this just-works:tm: with hardhat and geth, but I'd be surprised if it did. Someone needs to do a conversion from the |
Would it be ok if we hold off on merging this until we can free up some time to update |
Okay, so I guess this depends on what the expectation is. The data nim-ethers receives is I assume I'd rather expect it to just emit the Anyways, I'm not arguing against it, just want to make sure we understand that nim-ethers would do work that should probably be offloaded to apps. |
Good question @0x-r4bbit. For me, the logical thing that But even if we don't do this, and return the four bytes, then it still needs some work, because right now we're returning a string, not bytes.
Yes, let's do the update to nim-ethers first, then merge this. |
Hey friends, what's the state of this PR here? |
We have implementation for the custom errors in Nim thanks to @markspanbroek (codex-storage/nim-ethers#69). We just have to merge it all the way to nim-codex and then we can integrate it! |
Wonderful looking forward to it |
This PR updates the Marketplace and Proofs contract to use custom errors and
revert
insteadrequire
+"string"
to reduce the gas costs on reverts.