Giter Site home page Giter Site logo

flashloan-box's People

Contributors

cds-amal avatar mrdavey avatar rachblondon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flashloan-box's Issues

Compilation error after fresh install

Hi, I am just following the instructions on Aave's documentation page, but I run into the following error.
Here is the environment I am working on:
Windows 10

PS D:\GIT\temp> node -v
v12.16.3
PS D:\GIT\temp> npm -v
6.14.4
PS D:\GIT\temp> truffle version
Truffle v5.1.0 (core: 5.1.0)
Solidity v0.5.12 (solc-js)
Node v12.16.3
Web3.js v1.2.2

The installation of the truffle box is successful:

truffle unbox aave/flashloan-box
...
Unbox successful. Sweet!

And right after that, compilation throws the following error:

  PS D:\GIT\temp> truffle compile
  Error: Mnemonic invalid or undefined
      at checkBIP39Mnemonic (D:\GIT\temp\node_modules\@truffle\hdwallet-provider\src\index.ts:74:15)
      at new HDWalletProvider (D:\GIT\temp\node_modules\@truffle\hdwallet-provider\src\index.ts:104:23)
      at Object.<anonymous> (D:\GIT\temp\truffle-config.js:17:16)
      at Module._compile (internal/modules/cjs/loader.js:1133:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
      at Module.load (internal/modules/cjs/loader.js:977:32)
      at Function.Module._load (internal/modules/cjs/loader.js:877:14)
      at Module.require (internal/modules/cjs/loader.js:1019:19)
      at Object.require (internal/modules/cjs/helpers.js:77:18)
      at Function.load (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\config\dist\index.js:145:1)
      at Function.detect (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\config\dist\index.js:134:1)
      at Object.run (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\commands\compile.js:53:1)
      at Command.run (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\command.js:136:1)
      at Object.<anonymous> (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\cli.js:52:1)
      at __webpack_require__ (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 45f436e53fa694e98811:19:1)
      at C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\webpack:\webpack\bootstrap 45f436e53fa694e98811:65:1
      at Object.<anonymous> (C:\Users\Jorge\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js:71:10)
      at Module._compile (internal/modules/cjs/loader.js:1133:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
      at Module.load (internal/modules/cjs/loader.js:977:32)
      at Function.Module._load (internal/modules/cjs/loader.js:877:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
      at internal/main/run_main_module.js:18:47
  Truffle v5.1.0 (core: 5.1.0)
  Node v12.16.3

Seems to be an issue with the @truffle/hdwallet-provider, but manual reinstallatio of the module and its dependencies hasn't solved the problem.

A temporary solution I found was to comment out all references to HDWalletProvider in truffle-config.js.

Any help is greatly appreciated.

Error not found

Error: not found github/aave/flashloan-box/contracts/aave/ILendingPool.sol

This keeps coming up when I try to compile. How to resolve?

Thanks, Glen

won't migrate out of the box

I have just followed the directions in the readme, and I end at this error:

> Compiled successfully using:
   - solc: 0.6.12+commit.27d51765.Emscripten.clang

Error: Expected parameter 'from' not passed to function.
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/index.js:5:1
    at Array.forEach (<anonymous>)
    at Object.options (/usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/index.js:3:1)
    at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:65:1)
    at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:269:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:231:1

after that that I can't move forward with the commands in the readme.

I've made sure I'm running everything exactly as it is in the readme. It seems like the repo is out of date (even the links to the docs in the readme are dead). if this is the case, can we at least update the readme to reflect that?

It seems that OpenZepplin has changed its directory structure.

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol

has changed to

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol

The import statement may need to be changed accordingly.

Deployment of FlashLoan-Box is failing

Hi. I am following the tutorial https://docs.aave.com/developers/tutorials/performing-a-flash-loan/...-with-truffle.

After to do "migrate --reset", I am getting the following error:

Starting migrations...

Network name: 'ropsten'
Network id: 3
Block gas limit: 8000000 (0x7a1200)

1_initial_migration.js

Deploying 'Migrations'

**Error: *** Deployment Failed *****

"Migrations" -- senderAddress.toLowerCase is not a function.

at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:364:1
at process._tickCallback (internal/process/next_tick.js:68:7)

truffle(ropsten)>

Please, Can you review?

FlashLoan.deploy() not working.

I tried,

const FlashLoan = await hre.ethers.getContractFactory("FlashLoan");

const flashLoan = await FlashLoan.deploy("0x012bAC54348C0E635dCAc9D5FB99f06F24136C9A");

Flash Loan is not deployed. Address is POOLADDRESSPROVIDER AAVE-V3 for Sepolia Testnet.

Can you pls help.

thanks

Failure to migrate to Ropsten - TypeError: Cannot read property 'number' of null

Hi,

Wonder if anyone can help please? And apologies if this is something I've done, or that I'm not doing....!

Followed the instructions to the letter and I cannot get the flash loan contract to deploy to Rosten. Set up Rosten wallet with 1.19R. Got the account on Infura. Code compiles but when I deploy, I get; type error cannot read property 'number'.

Failure seems to be in:

node_modules/@trufflesuite/web3-provider-engine/index.js

Any ideas please?

Truffle v5.1.32 (core: 5.1.32)
Node v12.18.2
Compiler 0.6.6

Deploy log.txt

Throwing SyntaxError on await.

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

Provider Value needs to be wrapped in function

As per: https://www.trufflesuite.com/tutorials/using-infura-custom-provider

The provider value is wrapped in a function, which ensures that it won't get initialized until it's needed. This is especially important if connecting to multiple networks. (See the Networks configuration section of the documentation for more on this topic.)

example:

provider: () => new HDWalletProvider(process.env.DEPLOYMENT_ACCOUNT_KEY, "https://mainnet.infura.io/" + process.env.INFURA_API_KEY),

for all networks

Fail with error 'There is not enough liquidity available to borrow'

I've followed this tutorial: https://docs.aave.com/developers/tutorials/performing-a-flash-loan/...-with-truffle

And deployed successfully the smart contract on kovan network: https://kovan.etherscan.io/address/0xa1b8224b098dd59e8bd1a917043abf6acffd6757

I funded my account with some USDC using the aave interface, and trigger the flashloan function with the asset 0xe22da380ee6B445bb8273C81944ADEB6E8450422 (USDC)

The transaction fails: https://kovan.etherscan.io/tx/0x1c3741c383e1545698b17feaced8e6a1916295d6049fd9abb138f407355546e9

with the error: Fail with error 'There is not enough liquidity available to borrow'

Is the demo supposed to work out of the box or am I missing something?
Thanks!

Couldn't transfer ETH

when i execute l.flashloan('0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'), got an error Couldn\'t transfer ETH

Error in documentation Performing-a-flash-loan/...-with-truffle

Hi.

I am reviewing the documentation about Flash Loans in Truffle and I notice the following.

You need to add in the truffle-config.js a "from" field because if if you do not do it, you get the following error:

Compiling your contracts...

Everything is up to date, there is nothing to compile.

Error: Expected parameter 'from' not passed to function.
at expected_keys.forEach.key (/usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/index.js:5:1)
at Array.forEach ()
at Object.options (/usr/local/lib/node_modules/truffle/build/webpack:/packages/expect/index.js:3:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:65:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:269:1)
truffle(ropsten)>
(To exit, press ^C again or type .exit)
truffle(ropsten)>

I am deploying using the Ropster network and changed the file to:

// const path = require("path");
const HDWalletProvider = require("@truffle/hdwallet-provider")
require("dotenv").config()

module.exports = {
// See http://truffleframework.com/docs/advanced/configuration to customize your Truffle configuration!
// contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
development: {
host: "127.0.0.1",
port: 8545,
// gas: 20000000,
network_id: "*",
skipDryRun: true
},
ropsten: {
provider: new HDWalletProvider(process.env.DEPLOYMENT_ACCOUNT_KEY, "https://ropsten.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 3,
from:0xCAFE......
gas: 5000000,
gasPrice: 5000000000, // 5 Gwei
skipDryRun: true
},

Please, Can you review or update the documentation mentioning explicitly that you need the "from" field?

Thank you.

Regards.

FlashLoan Contracts Migration Error

Hi there,

I'm getting the following error when trying to migrate the FlashLoan contracts in my development environment:

Compiling your contracts...
===========================
Error: TypeError: soljson.Pointer_stringify is not a function
    at Object.compile (/home/mfalcone/.nvm/versions/node/v13.12.0/lib/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:72:1)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I'm using Truffle v5.1.0 and Node v.13.12.0 (I have also tried Node v.11.15.0 with same results).

Thank you,

Matias

Hijackedstack status error

when i run the flash loan part it gives me the following error

truffle(kovan)> await f.flashloan("0xd0a1e359811322d97991e03f863a0c30c2cf029c")
Uncaught:
StatusError: Transaction: 0xeb5e5353158f07d0b1c85e4cb64f3ea426e26908044ffb27e6c9c8f0efcea8f4 exited with an error (status 0).
at evalmachine.:1:11
at evalmachine.:2:49
at sigintHandlersWrap (vm.js:273:12)
at Script.runInContext (vm.js:140:14)
at runScript (C:\Users\alexx\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:270:1)
at Console.interpret (C:\Users\alexx\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\core\lib\console.js:285:1)
at bound (domain.js:416:15)
at REPLServer.runBound [as eval] (domain.js:427:12)
at REPLServer.onLine (repl.js:819:10)
at REPLServer.emit (events.js:376:20)
at REPLServer.emit (domain.js:470:12)
at REPLServer.Interface._onLine (readline.js:342:10)
at REPLServer.Interface._line (readline.js:671:8)
at REPLServer.Interface._ttyWrite (readline.js:1015:14) {
tx: '0xeb5e5353158c9c8f0efcea8f4',
receipt: {
blockHash: '0xf84ec886c2c6c80930a0bd178c44609afdfd8378681143a8f2026ccfe77705e4',
blockNumber: 25367850,
contractAddress: null,
cumulativeGasUsed: 117552,
from: '0x7ec63cc91f',
gasUsed: 62524,
logs: [],
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
status: false,
to: '0xb6cf18a9f7e8543d1d23058a979c1cd7ddd0f084',
transactionHash: '0xeb5e5353158f07d0b1c85e4cb64f3ea426e26908044ffb27e6c9c8f0efcea8f4',
transactionIndex: 1,
rawLogs: []
},
reason: undefined,
hijackedStack: 'StatusError: Transaction: 0xeb5e5353158f07d0b1c85e4cb64f3ea426e26908044ffb27e6c9c8f0efcea8f4 exited with an error (status 0). \n' +
' Please check that the transaction:\n' +
' - satisfies all conditions set by Solidity require statements.\n' +
' - does not trigger a Solidity revert statement.\n' +
'\n' +
' at Object.receipt (C:\Users\alexx\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\handlers.js:128:1)\n' +
' at processTicksAndRejections (internal/process/task_queues.js:95:5)\n' +
' at Function.start (C:\Users\alexx\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\contract\lib\override.js:49:1)'
}
truffle(kovan)>

I dont understand why im getting a hijack error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.