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
| from py_clob_client.client import ClobClient | |
| import os, json, time, requests | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| def best_prices(book): | |
| best_bid = float(book.bids[-1].price) if book.bids else None | |
| best_ask = float(book.asks[0].price) if book.asks else None | |
| last_trade = float(book.last_trade_price) |
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.8.0; | |
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract BabyBitcoin is ERC20, Ownable { | |
| event LogRemoveFromBlacklist(address[] indexed removed); | |
| event LogAddToBlacklist(address[] indexed blacklisted); |
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
| %builtins output | |
| from starkware.cairo.common.alloc import alloc | |
| from starkware.cairo.common.serialize import serialize_word | |
| # Computes the sum of the memory elements at addresses: | |
| # arr + 0, arr + 1, ..., arr + (size - 1). | |
| func array_sum(arr : felt*, size) -> (sum): | |
| if size == 0: | |
| return (sum=0) |
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.8.5; | |
| contract SturctMapTest { | |
| struct Match { | |
| address player1; | |
| address player2; | |
| uint256 damage; | |
| bool playing; |
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.8.5; | |
| /* | |
| By @gpylypchuk | |
| for a Challenge from @exactly_finance | |
| */ | |
| import "@openzeppelin/contracts/access/AccessControl.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; |
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: GPL-3.0 | |
| pragma solidity ^0.8.0; | |
| contract Ownable { | |
| address owner; | |
| constructor() { | |
| owner = msg.sender; | |
| } |
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: GPL-3.0 | |
| pragma solidity ^0.6.0; | |
| contract HotelRoomPayments { | |
| // Ether - pay smart contracts | |
| // Modifiers | |
| // Visibility | |
| // Events | |
| // Enums | |
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
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| df = pd.read_csv("BCHAIN-MKPRU.csv") | |
| df = df.iloc[::-1] | |
| df["200wma"] = df['Value'].rolling(window = 1400).mean() | |
| df = df[1400:] | |
| dates = pd.to_datetime(df['Date']) | |
| monthly = df[::30] |
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: GPL-3.0 | |
| pragma solidity ^0.8.6; | |
| contract TaskContract { | |
| uint nextId; | |
| struct Task{ | |
| uint id; | |
| string name; | |
| string description; |