New answers tagged

1

I found that OpenZeppelin seems to silence such compiler warnings about state mutability in this way: function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } This snippet is from there Context.sol ...


1

I believe that all of this can be solved with a single keyword - interface. For example: pragma solidity 0.4.26; interface IBaseContract { function func(uint _x) external view returns (bool); } contract BaseContract is IBaseContract { function func(uint _x) external view returns (bool) { return _x == 1; } } contract DerivedContract ...


Top 50 recent answers are included