Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwing SyntaxError on await. #17

Open
LFnetservices opened this issue Mar 17, 2021 · 1 comment
Open

Throwing SyntaxError on await. #17

LFnetservices opened this issue Mar 17, 2021 · 1 comment

Comments

@LFnetservices
Copy link

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
Copy link
Author

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

Compiling your contracts...

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant