Skip to content

Instantly share code, notes, and snippets.

View z0r0z's full-sized avatar
💭
codin qualia 🪄

ross z0r0z

💭
codin qualia 🪄
View GitHub Profile
@z0r0z
z0r0z / SquishiGame.sol
Created October 9, 2021 21:38
SushiToken Battle Royale on Polygon
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.9;
/// @notice Minimal ERC-20 token interface.
interface IERC20Minimal {
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
@z0r0z
z0r0z / LexTokenRestricted.sol
Created October 15, 2021 17:11
ross screwed up modules
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Single owner function access control module.
abstract contract LexOwnable {
event TransferOwner(address indexed from, address indexed to);
event TransferOwnerClaim(address indexed from, address indexed to);
address public owner;
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.9;
contract Token {
uint256 totalSupply;
string public name;
string public symbol;
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
contract Short {
string public s;
function short(string memory _s) public {
s = _s;
}
@z0r0z
z0r0z / LexTokenVotableBadge.sol
Created October 30, 2021 18:09
LexToken with owned minting, Compound-style governance and EIP-1238 'badge' nontransferability.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Adapted from RariCapital, https://github.com/Rari-Capital/solmate/blob/main/src/erc20/ERC20.sol,
/// License-Identifier: AGPL-3.0-only.
abstract contract LexToken {
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
@z0r0z
z0r0z / gist:f9851b98eeb197594b6c76b6e7923394
Created October 30, 2021 18:25
EIP-1238 token built on OpenZeppelin
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
contract BadgeVotes is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
@z0r0z
z0r0z / BadgeVotes.sol
Created October 30, 2021 18:26
EIP-1239 token built on OpenZeppelin
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
contract BadgeVotes is ERC20, ERC20Burnable, Ownable, ERC20Permit, ERC20Votes {
@z0r0z
z0r0z / Baal.sol
Created November 1, 2021 04:26
minor typographic changes
// SPDX-License-Identifier: UNLICENSED
/*
███ ██ ██ █
█ █ █ █ █ █ █
█ ▀ ▄ █▄▄█ █▄▄█ █
█ ▄▀ █ █ █ █ ███▄
███ █ █ ▀
█ █
▀ ▀*/
pragma solidity >=0.8.0;
@z0r0z
z0r0z / HODLPACToken.sol
Created November 3, 2021 17:58
HODLPACToken
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";
@z0r0z
z0r0z / TimelockController.sol
Created November 3, 2021 18:00
TimelockController
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).