Open spalladino opened 4 years ago
This is not possible in Buidler yet but it's a feature they're building. I think the issue is https://github.com/nomiclabs/buidler/issues/553.
I was mistaken, it's already possible using the RPC method you mentioned.
Here's an example how to use it:
(Note that compilerVersion
is the version of solc without a leading v
, e.g. "0.6.0"
.)
Ideally, the solution here would also provide stack traces to where the error occurs in the smart contract
@thegostep I'm pretty confident that stack traces through proxies do work. Here's an example I just ran:
$ hh run scripts/sample-script.js
Nothing to compile
Error: VM Exception while processing transaction: revert here
at Box.fail2 (contracts/Box.sol:30)
at Box.fail (contracts/Box.sol:26)
at <UnrecognizedContract>.<unknown> (0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0)
at process._tickCallback (internal/process/next_tick.js:68:7)
The only thing that is not working is the third line that shows UnrecognizedContract
, which is what this issue is about, but is a minor issue.
If you're not seeing stack traces beyond the proxy there must be something else going on in your setup. Are you using hardhat test
?
The only thing that is not working is the third line that shows UnrecognizedContract, which is what this issue is about, but is a minor issue.
yes this is what I am referring to, apologies for the lack of clarity in my request.
Buidler's wrapper around ethereumjs-vm,
buidler node
, provides meaningful logs regarding contract deployment, since it recognizes each contract from its bytecode:However, when deploying a proxy, the operation is shown on an
UnrecognizedContract
:See if it's possible to use
buidler_addCompilationResult
or a similar method to register the proxies bytecode and name, so they show asProxy
in the logs.