flashloan-box
flashloan-box copied to clipboard
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 (
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.