EatTheBlocks Forum

Build directory in flashloan course missing - flashloan.json missing error

Hi
I have completed the Profitable Flashloan course but if I try to deploy I get the error saying that flashloan.json is missing.
I see that there should be a “build” folder but I cannot find it anywhere. If I watch the video number 26 I see that the folder magically appears around 2.5 minutes into the video.
I am confused, how do I create this folder?

I think I know where I went wrong, I did not have any funds and it probably did not deploy the contract on mainnet.
Working on it

2 Likes

I am now getting the following error. Any suggestion?

2_deploy_contracts.js

/usr/local/lib/node_modules/truffle/build/459.bundled.js:25227
throw new Error(“Could not find artifacts for " + import_path + " from any sources”);
^

Error: Could not find artifacts for Flashloan from any sources
at Resolver.require (/usr/local/lib/node_modules/truffle/build/webpack:/packages/resolver/dist/lib/resolver.js:61:1)
at Object.require (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:172:1)
at ResolverIntercept.require (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/ResolverIntercept.js:22:1)
at /Users/gian/t-bot/profitable-flashloans/migrations/2_deploy_contracts.js:1:29
at Script.runInContext (vm.js:143:18)
at Script.runInNewContext (vm.js:148:17)
at Object.file (/usr/local/lib/node_modules/truffle/build/webpack:/packages/require/require.js:94:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:49:1)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
at setupDryRunEnvironmentThenRunMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:251:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:220:1)
at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)
Truffle v5.2.5 (core: 5.2.5)
Node v14.16.0

I have redone all the passages and now I get the following error message:

Error: *** Deployment Failed ***

“Migrations” – transaction could not be decoded: could not recover secp256k1 key: calculated Rx is larger than curve P.

at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:226:1)
at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)

Truffle v5.2.6 (core: 5.2.6)
Node v14.16.0

I have redone all steps making sure to use the versions as per the ones in the course but now I am getting a different message. Anyone has any idea why?

ompiling your contracts…

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

/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358
callback(err);
^
Error: Callback was already called.
at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:43:1
at WriteStream. (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:358:1)
at WriteStream.emit (events.js:315:20)
at WriteStream.destroy (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/level-ws/level-ws.js:140:1)
at finish (internal/streams/writable.js:670:14)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

Ok, after updating truffle to last version I am now back to the previous error:

Deploying ‘Migrations’

Error: *** Deployment Failed ***

“Migrations” – transaction could not be decoded: could not recover secp256k1 key: calculated Rx is larger than curve P.

at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:74:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:61:1)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:212:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:263:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:226:1)
at Command.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:136:1)

Truffle v5.2.6 (core: 5.2.6)
Node v14.16.0

I played with hdwallet version and now it tries to mine the transaction but I get the following error.
Also the transaction does not appear on Etherscan.

Error: *** Deployment Failed ***

“Migrations” – Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!.

at /usr/local/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:364:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Migration._deploy (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/migration.js:70:1)
at Migration._load (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/migration.js:57:1)
at Migration.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/migration.js:167:1)
at Object.runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:148:1)
at Object.runFrom (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:253:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate.js:216:1

Truffle v5.1.9 (core: 5.1.9)
Node v12.21.0

There is an issue with hdwallet-provider 1.2.4.
Try again with 1.2.3, and make sure you use the exact code of Github.

I have copied the code directly from Github, just updating the .env file.
Still receiving the same error and the transaction does not generate on Etherscan.
The hdwallet-provider version I was using before was 1.0.4 and now it is 1.2.3
Here below the versions I am using:
npm@12.21.0
truffle@5.1.9
web3@1.2.9
dotenv@8.2.0
uniswap/sdk@2.0.6
studydefi/money-legos@2.3.5

Any idea why it is happening?
Just a note, I have created the Wallet I am using with Metamask, will this make any difference when deploying the contract?

Try to create another project on Infura, and try several time. Sometime the network might be slow.