Skip to content

Instantly share code, notes, and snippets.


Markus Waas gorgos

View GitHub Profile
gorgos / High-Stakes Roulette Example
Last active Feb 20, 2021
Example for a contract for playing high-stakes Roulette on the blockchain
View High-Stakes Roulette Example
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BankOwned {
address public bankAddress;
constructor() {
bankAddress = msg.sender;
gorgos / ExampleSlidingWindowOracleDaiWethKovan.sol
Created Jan 9, 2021
ExampleSlidingWindowOracle with DAI + WETH for Kovan.
View ExampleSlidingWindowOracleDaiWethKovan.sol
pragma solidity 0.6.6;
pragma experimental ABIEncoderV2;
import "";
import "";
import "";
import "";
import "";
library SafeMath {
gorgos / TokenSwapWith0x.sol
Last active Jan 21, 2021
0x API Integration Example
View TokenSwapWith0x.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.4;
interface IERC20 {
function balanceOf(address owner) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
gorgos / BalancerExample.sol
Last active Dec 16, 2020
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at
View BalancerExample.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.2;
interface PoolInterface {
function swapExactAmountIn(address, uint, address, uint, uint) external returns (uint, uint);
function swapExactAmountOut(address, uint, address, uint, uint) external returns (uint, uint);
interface TokenInterface {
function balanceOf(address) external returns (uint);
View ExtCodeHashExample.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.10;
import "";
interface ExternalContractInterface {
function game() external returns(ExtCodeHashExample);
function payoutToWinner(address winner) external;
function withdrawTo(uint roundId, address receiver) external;
receive() external payable;
View FutureBlockHash.example.sol
mapping (address => uint256) gameWeiValues;
mapping (address => uint256) blockHashesToBeUsed;
function playGame() public {
if (!blockHashesToBeUsed[msg.sender]) {
// first run, determine block hash to be used
blockHashesToBeUsed[msg.sender] = block.number + 2; // use 2 or more
gameWeiValues[msg.sender] = msg.value;