I'm using solidity 0.5.0 and when i try to compile my contract it's giving me this error
Explicit type conversion not allowed from "bytes memory" to "address"
my code is this:
/// @dev get broker address for endpoint
function getEndpointBroker(address oracleAddress, bytes32 endpoint) public view returns (address)
{
return address(db.getBytes(keccak256(abi.encodePacked('oracles', oracleAddress, endpoint, 'broker'))));
}
Best Answer
Omitted the function
db.getBytes()
to avoid compilation errors in remix. You can choose:Or:
Edit: Solidity doc.