zack53 / Crypto-Arbitrage-Price-Bot

21 stars 8 forks source link

error when starting flash loan #46

Closed ghost closed 2 years ago

ghost commented 2 years ago

sometimes it presents this error... is it normal?

Flash Loan execution error { code: -32000, message: 'execution reverted' }

zack53 commented 2 years ago

I don't believe so. I usually get an error with reverted due to not enough profit to pay for the Aave Flash Loan fees. Can you give the entire error message here?

ghost commented 2 years ago

how many matic is needed to use flash loan?

I tried to deploy the contract and got this error

TypeError: Cannot read properties of undefined (reading 'eth') at main (C:\Users\Administrator\Crypto-Arbitrage-Price-Bot\src\scripts\deploy.js:9:31) at Object. (C:\Users\Administrator\Crypto-Arbitrage-Price-Bot\src\scripts\deploy.js:26:1) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47

zack53 commented 2 years ago

Looks like you are having an issue potentially getting the accounts from hardhat. You need to ensure you are overriding the default accounts in hardhat during the deploy. But, you may also need to run npm install to install all of the packages. The error seems to suggest that hardhat has not been installed via npm potentially.

ghost commented 2 years ago

I did numerous tests, and after commenting out lines 9 and 18 of the function in the deploy.js code it looked like this

npx hardhat run scripts/deploy.js --network hardhat AaveFlashLoanV3Factory deployed to: 0xa513902CE47191a5D4b63deFBa4f337347C512BE

it seems to me that the error is in getting the contract address aaveFlashLoanV3

now this error is displayed

Sem título