Skip to content

Instantly share code, notes, and snippets.

View gpylypchuk's full-sized avatar
🎸

geronimo pylypchuk gpylypchuk

🎸
View GitHub Profile
@gpylypchuk
gpylypchuk / client.py
Created February 22, 2026 20:41
fucking book prices on polymarket
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)
@gpylypchuk
gpylypchuk / BabyToken.sol
Last active November 2, 2022 18:43
Token for BabyBTC
// 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);
@gpylypchuk
gpylypchuk / array_sum.cairo
Created January 31, 2022 01:57
suma del array en cairo, doc oficial
%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)
@gpylypchuk
gpylypchuk / SturctMapTest.sol
Last active January 9, 2022 23:50
A little code to understand more about mapping and structs.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.5;
contract SturctMapTest {
struct Match {
address player1;
address player2;
uint256 damage;
bool playing;
@gpylypchuk
gpylypchuk / RockPaperScissors.sol
Last active January 10, 2022 00:04
Rock Paper Scissors - ERC20 ("RPS")
//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";
@gpylypchuk
gpylypchuk / Inheritance.sol
Created October 11, 2021 18:26
Inheritance with Secrets!
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract Ownable {
address owner;
constructor() {
owner = msg.sender;
}
@gpylypchuk
gpylypchuk / HotelRoomPayments.sol
Created October 11, 2021 18:04
HotelRoomPayments with Solidity Smart Contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.6.0;
contract HotelRoomPayments {
// Ether - pay smart contracts
// Modifiers
// Visibility
// Events
// Enums
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]
@gpylypchuk
gpylypchuk / TaskContract.sol
Created July 12, 2021 04:08
Practicas con Solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.6;
contract TaskContract {
uint nextId;
struct Task{
uint id;
string name;
string description;