I currently have a local chain with Ganache. Say I have two contracts written in Solidity:
Foo_v0_0_1.sol
Bar_v0_0_1.sol
In the code for my smart contract Foo_v0_0_1
, I have the following:
import "./Bar_v0_0_1.sol";
Bar_v0_0_1 private _bar;
...
function callBar() external {
_bar.func(msg.sender); // <-- EXECUTION FAILS HERE
}
I deploy these contracts and attempt the callBar
RPC call. This transaction fails on the internal call to the _bar
contract. I open this transaction with truffle debug <tx_hash>
, and step to the line where the transaction fails. When I print out the state and local variables, I see this in the output:
Contract variables:
_bar: 0x0000000000000000000000000000000000000000 of unknown class
My question: Why is this variable coming up as all zeroes? Is it an issue with how I deployed my contracts? Is it an issue with the truffle debugger not being able to correctly find the contract?
Any insight is greatly appreciated.
Bar_v0_0_1 private _bar;
- where is this variable initialized? Did you expect it to automatically attain some value??? – goodvibration Nov 4 '20 at 19:57