I ran some unit tests in Remix IDE using the Remix VM - Merge. It works without any issues. As I needed the ERC-1820 registry contract I switched to Remix VM - Mainnet fork for the unit tests. Some error indicated that the transactions triggered by the unit tests are executed twice on the Remix VM - Mainnet fork. So I created a very simple contract to check this issue:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract CallCounter {
uint256 callCounter = 0;
function call() public {
callCounter += 1;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return callCounter;
}
}
Deployed on the Remix VM - Mainnet fork, when triggering the call method with a transaction it always adds 2 to the callCounter instead of 1. This contract works perfectly fine on Remix VM - Merge or on a local Ganache blockchain. Is this a known bug in Remix IDE? When using the debugger I can always debug only the second execution of the transaction. Also there is no hash of two transactions. It seems like there is just one transaction sent.
To reproduce:
Deploy above contract using Remix on the Remix VM - Mainnet fork
call the "retrieve" view -> expected result: 0, actual result: 0
call the "call" function
call the "retrieve" view again -> expected result 1, actual result: 2
Remix IDE Versions: Remix Desktop 1.3.6 on Ubuntu 22.04 and current version deployed on https://remix.ethereum.org/ used in Firefox
I ran some unit tests in Remix IDE using the Remix VM - Merge. It works without any issues. As I needed the ERC-1820 registry contract I switched to Remix VM - Mainnet fork for the unit tests. Some error indicated that the transactions triggered by the unit tests are executed twice on the Remix VM - Mainnet fork. So I created a very simple contract to check this issue:
Deployed on the Remix VM - Mainnet fork, when triggering the call method with a transaction it always adds 2 to the callCounter instead of 1. This contract works perfectly fine on Remix VM - Merge or on a local Ganache blockchain. Is this a known bug in Remix IDE? When using the debugger I can always debug only the second execution of the transaction. Also there is no hash of two transactions. It seems like there is just one transaction sent.
To reproduce:
Remix IDE Versions: Remix Desktop 1.3.6 on Ubuntu 22.04 and current version deployed on https://remix.ethereum.org/ used in Firefox