Error while deploying smart contracts to Ropsten

Hi there,
I’m trying to deploy my smart contracts to Ropsten test network using hdwallet provider and Infura but I’ve been going crazy because of this error I cannot solve:
Starting migrations…

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


Deploying ‘Migrations’

Error: *** Deployment Failed ***

“Migrations” – senderAddress.toLowerCase is not a function.

My truffle-config.js file configuration is the following:

const HDWalletProvider = require(’@truffle/hdwallet-provider’);
const infuraKey = “keynumber”
const fs = require(‘fs’);
const mnemonic = fs.readFileSync(".secret").toString().trim();

module.exports = {
ropsten: {
provider: () =>
new HDWalletProvider(mnemonic,${infuraKey}
network_id: 3, // Ropsten’s id
from: ganache first address,
gas: 5500000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
Could someone give a me a hint? Any help will be very appreciated!

Hi @Matteo_Tabarelli and welcome to our Infura community.

Could you please let me know which version of Truffle and HD Wallet provider are you using?

Waiting for you answer.

Thank you :slight_smile:
Truffle v5.4.18
HDWallet-provider v1.6.0

@Matteo_Tabarelli It looks like the error lies in senderAddress.toLowerCase - you may want to check your code to make sure that function is set up properly, as it’s not being recognized as one.

The problem is that I didn’t implement that function in my own contracts, in fact I have this problem with a fresh project as well (for instance using truffle unbox metacoin). So I think the problem is related to something else