Skip to content

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

@AtticusLScott

Description

@AtticusLScott

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions