flashloan-box icon indicating copy to clipboard operation
flashloan-box copied to clipboard

Throwing SyntaxError on await.

Open LFnetservices opened this issue 3 years ago • 1 comments

Step 8 in the docs,

let f = await Flashloan.deployed() await f.flashloan(RESERVE_ADDRESS)

no matter how i enter that (with the proper address), it returns

SyntaxError: await is only valid in async function at new Script (vm.js:83:7) at Object.createScript (vm.js:277:10) at Object.file (/usr/local/lib/node_modules/truffle/build/webpack:/packages/require/require.js:93:1) at Object.exec (/usr/local/lib/node_modules/truffle/build/webpack:/packages/require/require.js:121:1) at Promise (internal/util.js:274:30) at new Promise () at bound exec (internal/util.js:273:12) at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/exec.js:80:1)

Im running truffle with multipass on windows 10 no install issues or anything

LFnetservices avatar Mar 17 '21 20:03 LFnetservices

ubuntu@primary:~/flashloan-aave-box/flashloan-box$ sudo truffle console --network kovan truffle(kovan)> migrate --reset

Compiling your contracts...

  • Fetching solc version list from solc-bin. Attempt #1

truffle(kovan)> let f = await Flashloan.deployed() && await f.flashloan(0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD) Thrown: ReferenceError: Flashloan is not defined at evalmachine.:1:9 truffle(kovan)>

LFnetservices avatar Mar 17 '21 23:03 LFnetservices