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 / ETHfeed.sol
Created February 4, 2022 04:31
simple ETH receiver that automates fees
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
contract ETHfeed {
uint256 feeRate;
address feeReceiver;
constructor(uint256 feeRate_) {
@z0r0z
z0r0z / ERC20.sol
Created February 3, 2022 06:53
simple ethereum token
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
/// @notice Basic ERC20 implementation.
contract ERC20 {
string public name;
string public symbol;
uint8 constant public decimals = 18;
uint public totalSupply;
@z0r0z
z0r0z / FERC721.sol
Last active January 25, 2022 14:27
simple NFT with license mapping for each token Id
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
contract FERC721 is ERC721("FERC721", "FERC"), Ownable {
string public baseURI;
@z0r0z
z0r0z / OwnerNFT.sol
Created January 25, 2022 01:51
mint an NFT based on admin rights
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/src/tokens/ERC721.sol";
interface IOwnable {
function owner() external view returns (address);
}
@z0r0z
z0r0z / ClubSig.sol
Last active September 24, 2022 19:47
EIP-712-signed multi-signature contract with NFT identifiers for signers and ragequit
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
import "https://github.com/Rari-Capital/solmate/src/tokens/ERC721.sol";
import "https://github.com/kalidao/kali-contracts/blob/main/contracts/utils/NFThelper.sol";
/// @notice Minimal ERC-20 interface.
interface IERC20minimal {
function balanceOf(address account) external view returns (uint256);
@z0r0z
z0r0z / SingleNFT.sol
Last active June 2, 2022 08:20
1-of-1 NFT built on Solmate
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol";
/// @notice 1-of-1 NFT.
contract SingleNFT is ERC721 {
string internal URI;
constructor(
@z0r0z
z0r0z / XYKstrategy.sol
Created January 16, 2022 09:57
uniswap-inspired exchange logic for helios 1155 LPs
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Babylonian method for computing square roots.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/utils/FixedPointMathLib.sol)
library SqrtMath {
function sqrt(uint256 x) internal pure returns (uint256 z) {
assembly {
// start off with z at 1
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "https://github.com/lexDAO/Kali/blob/main/contracts/tokens/erc20/ERC20.sol";
interface IERC20 {
function balance(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external;
}
@z0r0z
z0r0z / Payment.sol
Created January 14, 2022 17:24
simple push / pull payment
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract Payment {
address public payee = msg.sender;
string public agreement;
uint256 public payment = 0.1 ether;
@z0r0z
z0r0z / ThriftiSwap.sol
Created January 11, 2022 00:57
1155 AMM that swaps between token Id amounts - Modified from UniswapV2
// SPDX-License-Identifier: GPL-3.0
pragma solidity =0.5.16;
import "https://github.com/Uniswap/v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
import "https://github.com/Uniswap/v2-core/blob/master/contracts/UniswapV2ERC20.sol";
import "https://github.com/Uniswap/v2-core/blob/master/contracts/libraries/Math.sol";
import "https://github.com/Uniswap/v2-core/blob/master/contracts/libraries/UQ112x112.sol";
import "https://github.com/Uniswap/v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
import "https://github.com/Uniswap/v2-core/blob/master/contracts/interfaces/IUniswapV2Callee.sol";