Legacy access request rate exceeded


during contract deployment to any testnet using the truffle-hdwallet-provider, I am getting the Error: “legacy access request rate exceeded”
my truffle config is set up like so:

 ropsten: {
      provider: function(){
        return new HDWalletProvider(process.env.MNEMONIC,'https://ropsten.infura.io + process.env.INFURA_PROJECT_ID);
      gas: 8000000,
      gasPrice: 25000000000,
      network_id: 3

Can anyone advise on how to resolve this issue.


You need to setup an account at infura.io/register and use the Project ID with your request URL in the following format

1 Like

Hi Mike,

Thank you for responding.

I had already done this, just to be sure however I have deleted the project and remade a new project several times and only received the same results I also added the address used to deploy my contract to the addresses white list just in case that was the issue.
I tried “CURL https://ropsten.infura.io/INFURA_PROJECT_ID” but get a 404 error

Curling that URL won’t work that way, needs to be structured as a JSONRPC or WSS request, you are also missing the /v3/ part of the URL, this section of the docs breaks down how to send requests, https://infura.io/docs/gettingStarted/makeRequests

Hi Mike,

Thankyou, the issue was that I wasn’t including the /v3/ within my URL
sorry to bug you over such a stupid mistake

No problem glad you got it working!

I’m also having this problem with truffle migrate using latest Truffle 5.1.0

const HDWalletProvider = require('@truffle/hdwallet-provider')

module.exports = {
  networks: {
    ropsten: {
      provider: new HDWalletProvider(process.env.MNEMONIC, 'https://ropsten.infura.io/v3/' + process.env.INFURA_PROJECT_ID),
      gas: 4700000,
      network_id: 3
  migrations_directory: './migrations',

Hi @Guillaume_Duveau can you provide the error output you’re receiving?

Thank you! Since the configuration in truffle-config.js file is in low version of ropsten, so I changed that

   ropsten: {
      provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
      network_id: 3,       // Ropsten's id
      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 )