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 / KaliDAOinvestmentClub.sol
Created January 9, 2022 19:43
programmatically enforce membership doesn't exceed 100 investment club limit
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Modern and gas-optimized ERC-20 + EIP-2612 implementation with COMP-style governance and pausing.
/// @author Modified from RariCapital (https://github.com/Rari-Capital/solmate/blob/main/src/erc20/ERC20.sol)
/// License-Identifier: AGPL-3.0-only
abstract contract KaliDAOtoken {
/*///////////////////////////////////////////////////////////////
EVENTS
@z0r0z
z0r0z / gist:6db3a3ef73a207acb204f7d6aeb107f6
Created January 9, 2022 19:42
programmatically enforce membership doesn't exceed 100 investment club limit
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Modern and gas-optimized ERC-20 + EIP-2612 implementation with COMP-style governance and pausing.
/// @author Modified from RariCapital (https://github.com/Rari-Capital/solmate/blob/main/src/erc20/ERC20.sol)
/// License-Identifier: AGPL-3.0-only
abstract contract KaliDAOtoken {
/*///////////////////////////////////////////////////////////////
EVENTS
@z0r0z
z0r0z / Receivoooooor.sol
Created January 8, 2022 07:58
Accepts data and records sender info
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
contract Receivoooooor {
mapping(address => uint256) public registry;
fallback(bytes calldata input) external returns (bytes memory) {
(address sender, uint256 amount) = abi.decode(input, (address, uint256));
registry[sender] = amount;
}
@z0r0z
z0r0z / MoreUsefulToken.sol
Created January 8, 2022 07:57
Token that passes data to contract fallbacks on transfer
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
/// @notice Basic ERC20 implementation.
contract TestERC20 {
string public name;
string public symbol;
uint8 constant public decimals = 18;
uint public totalSupply;
@z0r0z
z0r0z / MultiSig.sol
Created January 7, 2022 02:03
EIP-712-signed multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
error NoExecParity();
error NoSigParity();
error NotSigner();
error SigOutOfOrder();
@z0r0z
z0r0z / GeneralizedGrimoire.md
Created January 5, 2022 02:15
MCV Grimoire for Investment Clubs, in github markdown with generalized references to allow for more options in chain and code references.

OPERATING AGREEMENT OF [[DAO LLC NAME]]

This Operating Agreement (this “Agreement”) sets forth the rights and obligations among [[DAO LLC NAME]], a Delaware limited liability company (the “Org”) and the members of the Org.

BACKGROUND

A. The Org has been formed for the purposes contemplated by this Agreement by the filing with the Secretary of State of the State of Delaware of a Certificate of Formation (the “Certificate”) in accordance with the Delaware Limited Liability Company Act (the “Delaware LLC Act”).

B. This Agreement is being entered into for the purposes of organizing and establishing the governance and operations of the Org and the rights and obligations of membership in the Org.

@z0r0z
z0r0z / DAO Representation Agreement.md
Last active March 11, 2022 17:32
Agreement to establish off-chain representation on behalf of DAO. Can be useful to manage legal operations regardless of DAO legal structure.

DAO REPRESENTATION AGREEMENT

This DAO REPRESENTATION AGREEMENT (this “Agreement”) is made as of [[Effective Date]], by and between [[DAO Name]] (the “DAO”)[, a [[DAO Legal Structure]]] rooted on the [[Blockchain Name]], chainId:[[chainId]] at the public key [[DAO Public Key]] (the “Public Key”), and [[Representative Name]], a [[Representative Legal Structure]] (the “Representative”).

RECITALS

WHEREAS, the DAO desires to engage the Representative to manage its legal operational concerns, and the Representative desires to offer such services on the terms set forth herein;

NOW, THEREFORE, in consideration of the mutual covenants, agreements, representations and warranties contained herein, and intending to be legally bound hereby, the parties hereto hereby agree as follows:

@z0r0z
z0r0z / Accredrop.sol
Created January 2, 2022 03:59
Token drop with balance-based accreditation check
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.4;
import "https://github.com/lexDAO/Kali/blob/main/contracts/libraries/SafeTransferLib.sol";
/// @notice Minimal ERC-20 interface.
interface IERC20minimal {
function balanceOf(address account) external view returns (uint256);
}
@z0r0z
z0r0z / gist:eabf7cdbfd54fdc249390137e60fdd87
Created December 31, 2021 17:43
whitelisted, conditioned, time-restricted
// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;
/// @notice Basic ERC20 implementation.
contract TestERC20 {
string public name;
string public symbol;
uint8 constant public decimals = 18;
uint256 public totalSupply;
@z0r0z
z0r0z / NFTerc20.sol
Created December 31, 2021 03:31
ceci n'est pas une NFT
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
/// @notice BasicAF ERC20-compatible NFT implementation.
contract NFTerc20 {
string public name;
string public symbol;
string public tokenURI;
uint8 constant public decimals = 0;
uint public totalSupply = 1;