Here's the code:
I compile these two contracts together and deploy Bar contract. After deploying it I have a contract account address where it has been deployed on the blockchain:
0x692a70d2e424a56d2c6c27aa97d1a86395877b3a
Then I call Bar.createFoo() and get a new contract account address where the newly created contract Foo has just been deployed:
0xfcca7851eb308c57543421141f6fefbd1f4a2bef
My first question is:
What is stored in the variable whatAmI? Is it the address of Bar or is it the address of my account(externally owned account) that called Bar.createFoo()?
My second question is:
I've added some means to log the whatAmI variable here:
Compiler throws an error: TypeError: Cannot read property 'event' of undefined
What am I doing wrong here?