Skip to content

Instantly share code, notes, and snippets.

@morkeltry
Last active May 27, 2020 11:48
Show Gist options
  • Save morkeltry/10e0e2b890f7d986ce676c04456e6c83 to your computer and use it in GitHub Desktop.
Save morkeltry/10e0e2b890f7d986ce676c04456e6c83 to your computer and use it in GitHub Desktop.
Remix IDE v0.10.1 bug in transacting on VM deployed contracts
  • Delete 1_Storage.sol, 2_owner.sol, 3_Ballot.sol, 4_Ballot.test.sol
  • Add Contract1.sol and Contract2.sol
  • Add SOLIDITY COMPILER and DEPLOY & RUN TRANSACTIONS plugins
  • Select Deploy and Run tab
  • CTRL-S to Compile Contract1.sol and click Deploy
  • Test that the dumpDataCache function works in Contract1 by expanding it, populating the fields, clicking transact and then expanding the transaction results in the remix console.

Expected result:

input :  0x27...
decoded input : { anything : ..., ... }
decoded output   { "0": ... }
  • Switch to Contract2.sol, CTRL-S to Compile Contract2.sol and click Deploy
  • Retest the dumpDataCache function in Contract1.

Expected result:

input :  0x27...
decoded input : { anything : ..., ... }
decoded output   { "0": ... }

Actual result:

input :  0x27...
decoded input : -
decoded output : -

Bug reproduced on Firefox 76.0.1 for Ubuntu;

compiler versions v0.6.6+commit.6c089d02 and 0.4.26+commit.4563cfc

pragma solidity ^0.6.0;
contract Number1 {
mapping (bytes32 => bytes32[]) dataCache;
uint8 thisContract = 1;
bytes32 isDifferentFromTheOther;
function dumpDataCache (bytes32 anything) public returns (string memory, uint256, bytes32[] memory) {
return ("Contract 1 returns:", thisContract, dataCache[anything]);
}
}
pragma solidity ^0.6.0;
contract Number2 {
mapping (bytes32 => bytes32[]) dataCache;
uint8 thisContract = 2;
function dumpDataCache (bytes32 anything) public returns (string memory, uint256, bytes32[] memory) {
return ("Contract 2 returns:", thisContract, dataCache[anything]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment