This file contains hidden or 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 | |
// | |
// Let's play connect-four! | |
// Check out the contract for details. | |
pragma solidity 0.8.17; | |
contract ConnectFour { | |
mapping(bytes32 => Game) public games; // Game IDs ==> Games | |
mapping(address => uint256) public nrOfGames; // User ==> Nr. of Games |
This file contains hidden or 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.6.0 <0.7.0; | |
interface IFreeFromUpTo { | |
function freeFromUpTo(address from, uint256 value) external returns (uint256 freed); | |
} | |
contract GasSaver { | |
IFreeFromUpTo chi; |
This file contains hidden or 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
pragma solidity ^0.6.0; | |
import "@chainlink/contracts/src/v0.6/dev/AggregatorInterface.sol"; | |
contract MyContract { | |
AggregatorInterface internal feed; | |
constructor(address _aggregator) public { | |
feed = AggregatorInterface(_aggregator); | |
} |
This file contains hidden or 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
pragma solidity ^0.6.0; | |
contract Escrow { | |
enum State { AWAITING_PAYMENT, AWAITING_DELIVERY, COMPLETE } | |
State public currState; | |
address public buyer; | |
address payable public seller; | |
This file contains hidden or 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
pragma solidity ^0.5.0; | |
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; | |
import "../../flashloan/base/FlashLoanReceiverBase.sol"; | |
import "../../configuration/LendingPoolAddressesProvider.sol"; | |
import "../../lendingpool/LendingPool.sol"; | |
contract FlashLoanReceiverExample is FlashLoanReceiverBase { |