Skip to content

Instantly share code, notes, and snippets.

View JonPizza's full-sized avatar
🍕
Hungry

Jonathan York JonPizza

🍕
Hungry
View GitHub Profile
@JonPizza
JonPizza / ERC20Token.sol
Created January 30, 2022 00:37
ERC20 Token
// SPDX-License-Identifier: UNLICENCED
pragma solidity ^0.8.7;
contract ERC20Token {
string public constant name = "Token";
string public constant symbol = "TKN";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
@JonPizza
JonPizza / contracts...Leveraged.sol
Created April 30, 2021 18:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.1+commit.df193b15.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "./interfaces/IERC20.sol";
import "./Uniswap.sol";
contract Leveraged {
IERC20 usdt = IERC20(0xd9145CCE52D386f254917e481eB44e9943F39138);
@JonPizza
JonPizza / .deps...npm...@uniswap...lib...contracts...libraries...TransferHelper.sol
Created April 30, 2021 18:42
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.1+commit.df193b15.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.6.0;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
@JonPizza
JonPizza / evolve.py
Created June 11, 2019 20:01
Evolution Simulator
import sys, time, pygame
from random import randint
from pygame.locals import *
NUMBER_PLAYERS = 2000 # Lower if this runs slow on your computer
goal_pos = [735, 735] # The pixel that you want the AI to get to. If you want "Survival Mode" (Trying to keep dots alive) set to [400, 400]
def dist_to_goal(pos, goal_pos):
return abs(pos[0]-goal_pos[0]) + abs(pos[1]-goal_pos[1])