Here is the code:
Calling contract:
pragma solidity ^0.4.24;
contract Caller {
address public called_address;
constructor() public payable {
}
function set_address(address _addy) public {
called_address = address(_addy);
}
function () public payable{
Called c = Called(called_address);
if (c.get() > 10 ){
revert("Too much sauce");
}
c.set();
}
}
interface Called{
function set() external;
function get() external view returns (uint);
}
Called Contract:
pragma solidity ^0.4.24;
contract Called{
uint public number;
function myuint() public view returns(uint _number) {
_number = number;
}
function set() public {
number++;
}
function get() public view returns (uint){
return number;
}
}
When I call the fallback function I get an error. This only happens when using Web3 provider, but works well in JavaScript VM. Saw this question too Can't call another contract constant function in Remix in Web3 provider mode, but it works in Javascript VM
Is it a bug in Remix? Does my code have an error? Why do I get different results with the different environments?