Not able to debug a contract created by another contract that subsequently causes the transaction to revert
See original GitHub issue- I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
I’m trying to debug a transaction - I’ve got all the contracts linked to source code except one…
Addresses affected:
0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab - ProcessRegistry
0x7C728214be9A0049e6a86f2137ec61030D0AA964 - BindingAccessControl
0x4bf749ec68270027C5910220CEAB30Cc284c7BA2 - TaskRoleContract_Contract
0x3Cd8e615aF0774eE283329454962abbD4F2b427A - Order_To_Cash_Contract
0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb - Goods_Shipement_Factory
0x5f8e26fAcC23FA4cbd87b8d9Dbbd33D5047abDE1 - Order_To_Cash_worklist
0x8C6AAd0C92a48112aAa0e6e8F98A160120f17059(UNKNOWN)
It turns out the one I can’t link has a null binary - but it is in this one where the error is occurring.
All the others have been deployed by web3 - the one with the null binary (0x) has been created by another contract:
Goods_Shipement_Contract newContract = new Goods_Shipement_Contract(parent, worklist, processRegistry);
is there any way such contracts can be linked to their source code so they can be debugged?
For reference the null binary gets returned here: packages/truffle-debugger/lib/session/sagas/index.js
let binaries = yield* web3.obtainBinaries(addresses, blockNumber);
Steps to Reproduce
I can provide my source files if you’d like… + ganache-cli data
Environment
- Operating System: ubuntu
- Ethereum client: ganache-cli
- Truffle version Truffle v5.0.17 (core: 5.0.16)
- node version Node v11.14.0
- npm version 6.7.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
How to Debug the Most Common Solidity Smart Contract Errors
1. Execution reverted errors occur when a called Smart Contract decides to prevent further execution of a transaction that goes against its ...
Read more >How to Debug Ethereum Smart Contracts | by Abhishek Sharma
Revert. Transaction revert will occur when you are trying to execute a transaction that cannot be executed according to the logic of smart...
Read more >Breach of Contract: Anticipatory Breach (Repudiation) - Nolo
If the contract is for the sale of property, repudiation occurs when one party transfers (or makes a deal to transfer) the property...
Read more >Characterizing Transaction-Reverting Statements in Ethereum ...
Step 1: Statement selection. Since there are 67,770 transaction-reverting statements in the 3,866 dapp contracts, it is infeasible to analyze ...
Read more >ethers.js - How can I find the line of code that caused a ...
We were not able to estimate gas. There might be an error in the contract and this transaction may fail. If I proceed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

OK, I’ve just put up PR #2052 which should fix this. Note that you’ll still get that
(UNKNOWN)display on startup, but you can ignore that; once this is merged the call itself should work fine.OK, great! In that case I’m pretty sure I know what I need to do to fix this.