EatTheBlocks Forum

Type error at runtime

Julien,

My Flashloan.sol compiles fine, but when I run-arbitrage.js I get a Type error about the property ‘address’. I have attached the error. The portion of the code it is referring to is:
const flashloan = new web3.eth.Contract(
Flashloan.abi,
Flashloan.networks[networkId].address

I don’t know what this is referencing - is it the address of the Flashloan smart contract on mainnet? I know this is something basic that I’m missing, but I am new to this.

Also, I was under the impression that once Flashloan.sol compiles and is deployed to the blockchain that the builds\contracts\Flashloan.json would show the ABI for the contact and populate the networks field. I believe you mentioned this in video 27. When I run truffle migrate --mainnet --reset everything seems fine, but I don’t see the ABI in the build file, which makes me thing something is not working properly.

I appreciate your help,
Mike

It sounds like you still have not deployed the contract which you need to do first

1 Like