0

To test my EVM smart contract on mainnet, I use ganache to fork mainnet and implement the truffle test but failed with error code as the title.

My Environment:

  • RPC endpoint: https://bsc-dataseed1.defibit.io
  • Truffle v5.2.6 (core: 5.2.6)
  • Solidity - 0.8.13 (solc-js)
  • Node v18.13.0
  • Web3.js v1.2.9
  • Ganache CLI v6.12.2 (ganache-core: 2.13.2)

The steps to reproduce:

  1. fork mainnet
ganache-cli --fork https://bsc-dataseed1.defibit.io --unlock "0x14f62daeee9ef67588bc882480b1c7992980fcaa" --unlock "0x6adb5974d4fc421aad4105f09c68f85700f5c36b"
  1. Run truffle test
truffle test --network development

And it shows the error revert TX Limit Exceeded -- Reason given: TX Limit Exceeded. I think it should not be the issue from my contract code but from the environment. But I am not able to find any reference from google. It will be very appreciated if anybody can give me a hint.

The full log of error herewith FYI:

Deployer accounts: 0x41BD4fa20FBe952bfe441C3C8996EAB8aC1F2cF2
{ afntyAddr: '0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047' }


  Contract: My contract test
    ✓ Set up all related contract ready (1299ms)
    ✓ Owner set cutOff (128ms)
{
  migratorOwner: '0x41BD4fa20FBe952bfe441C3C8996EAB8aC1F2cF2',
  migrator: '0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047'
}
{ contractNewTokenBalance: 500000 }
{ contractNewTokenBalance: 0 }
    ✓ Owner input and withdraw new token (57068ms)
    1) Allow users to migrate

    Events emitted during test:
    ---------------------------

    Warning: Could not decode event!

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 16674738392 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 16674738392 (type: uint256)
      )

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        to: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
        value: 1739430161 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        to: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
        value: 1739430161 (type: uint256)
      )

    Warning: Could not decode event!

    Warning: Could not decode event!

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 1739430161 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x81f29597181E99C5eD48a085401dd42fd528d781 (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 1739430161 (type: uint256)
      )

    Warning: Could not decode event!

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 16633051545 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x10ED43C718714eb63d5aA57B78B54704E256024E (type: address),
        to: <indexed> 0xFcf32695BAd0FD181f468F1792aFbF1bA09D4188 (type: address),
        value: 16633051545 (type: uint256)
      )

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
        to: <indexed> 0x0ED943Ce24BaEBf257488771759F9BF482C39706 (type: address),
        value: 2125942 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
        to: <indexed> 0x0ED943Ce24BaEBf257488771759F9BF482C39706 (type: address),
        value: 2125942 (type: uint256)
      )

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
        to: <indexed> 0xEe3C1B43482bf018ac960EeA8B57d8e576368D57 (type: address),
        value: 5301567942 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x0000000000000000000000000000000000000000 (type: address),
        to: <indexed> 0xEe3C1B43482bf018ac960EeA8B57d8e576368D57 (type: address),
        value: 5301567942 (type: uint256)
      )

    Warning: Could not decode event!

    Warning: Could not decode event!

    Warning: Could not decode event!

    Ambiguous event, possible interpretations:
    * UsingERC20.Transfer(
        from: <indexed> 0x14f62dAEEE9ef67588BC882480b1C7992980fCaA (type: address),
        to: <indexed> 0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047 (type: address),
        value: 500000000000000 (type: uint256)
      )
    * IERC20.Transfer(
        from: <indexed> 0x14f62dAEEE9ef67588BC882480b1C7992980fCaA (type: address),
        to: <indexed> 0x39FbDfF41f8a2A0F6FC6292507344C95DC8F8047 (type: address),
        value: 500000000000000 (type: uint256)
      )


    ---------------------------


  3 passing (1m)
  1 failing

  1) Contract: My contract test
       Allow users to migrate:
     Error: Returned error: VM Exception while processing transaction: revert TX Limit Exceeded -- Reason given: TX Limit Exceeded.
      at Context.<anonymous> (test/testContract.js:58:20)
      at processTicksAndRejections (node:internal/process/task_queues:95:5
Eric Lee
  • 171
  • 2
  • 10

0 Answers0