This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependency inversion principle | |
########################################## | |
class FXConverter: | |
def convert(self, from_currency, to_currency, amount): | |
print(f'{amount} {from_currency} = {amount * 1.2} {to_currency}') | |
return amount * 1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
interface OracleInterface{ | |
function receiveRequest() external returns (uint256); | |
} | |
contract BaseContract{ | |
uint public randomNumber = 0; | |
OracleInterface public obj; | |
mapping(uint256=>bool) myRequests; |