Skip to content

Instantly share code, notes, and snippets.

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

ross z0r0z

💭
codin qualia 🪄
View GitHub Profile
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
import './KaliDAOtoken.sol';
import './KaliDAOnftHelper.sol';
/// @notice Simple gas-optimized DAO core module.
contract KaliDAO is KaliDAOtoken, KaliDAOnftHelper {
/*///////////////////////////////////////////////////////////////
@z0r0z
z0r0z / NomiDAO.sol
Created November 20, 2021 07:56
tribute to master chef and community of weirdos
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation with COMP-style governance,
/// @author Adapted from RariCapital, https://github.com/Rari-Capital/solmate/blob/main/src/erc20/ERC20.sol,
/// License-Identifier: AGPL-3.0-only.
contract NomiToken {
/*///////////////////////////////////////////////////////////////
EVENTS
@z0r0z
z0r0z / NFTcloner.sol
Created December 12, 2021 08:45
some bs for the intern
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC-721 + ERC-20/EIP-2612-like implementation.
contract NFTclone {
/*///////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
@z0r0z
z0r0z / Escrow.sol
Created December 13, 2021 22:04
Escrow for NFT and ERC20 using IERC20
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
/// @notice Standard ERC-20 token interface with EIP-2612 {permit} extension.
interface IERC20 {
/// @dev ERC-20:
function allowance(address owner, address spender) external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
@z0r0z
z0r0z / NFT.sol
Last active February 1, 2022 14:36
Based NFT implementation.
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Based NFT implementation.
abstract contract NFT {
/*///////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
@z0r0z
z0r0z / Vesting.sol
Created December 24, 2021 17:32
multi asset multi account multi deadline vesting escrow
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Modified from Gnosis (https://github.com/gnosis/gp-v2-contracts/blob/main/src/contracts/libraries/GPv2SafeERC20.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
library SafeTransferLib {
/*///////////////////////////////////////////////////////////////
ETH OPERATIONS
@z0r0z
z0r0z / Multisig.sol
Last active March 9, 2022 01:50
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
@z0r0z
z0r0z / Multisig.sol
Created December 25, 2021 23:40
Simple gas-optimized multi-signature contract with crowdsourced enhancements.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
@z0r0z
z0r0z / MultiSig.sol
Created December 26, 2021 03:20
EIP-712-signed multi-signature contract
// SPDX-License-Identifier: GPL-3.0-or-later
error NoExecParity();
error NoSigParity();
error NotSigner();
error SigOutOfOrder();
@z0r0z
z0r0z / MultiSig.sol
Created December 26, 2021 03:28
EIP-712-signed multi-signature contract
// SPDX-License-Identifier: GPL-3.0-or-later
error NoExecParity();
error NoSigParity();
error NotSigner();
error SigOutOfOrder();