Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
summonin 🪄

z0r0z

💭
summonin 🪄
View GitHub Profile
@z0r0z
z0r0z / MockERC1155votes.sol
Last active Jun 26, 2022
Compound-like voting extension for ERC1155.
View MockERC1155votes.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import "https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol";
import "https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeCastLib.sol";
/// @notice Compound-like voting extension for ERC1155.
/// @author z0r0z.eth
abstract contract ERC1155votes is ERC1155 {
using SafeCastLib for uint256;
@z0r0z
z0r0z / TokenWarrant.sol
Created May 27, 2022
tokenizing agreement with hashes and payables
View TokenWarrant.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol';
contract TokenWarrant is ERC1155 {
mapping(uint256 => string) public metas;
function uri(uint256 id) public override view returns (string memory) {
return metas[id];
View Bankruptcy.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import "https://github.com/kalidao/multi-sig/blob/main/src/interfaces/IClubLoot.sol";
import "https://github.com/Rari-Capital/solmate/blob/v7/src/tokens/ERC1155.sol";
import "https://github.com/kalidao/multi-sig/blob/main/src/libraries/FixedPointMathLib.sol";
import "https://github.com/kalidao/multi-sig/blob/main/src/libraries/SafeTransferLib.sol";
/// @notice Ch.11 bankruptcy token
contract Bankruptcy is ERC1155 {
View Check.sol
pragma solidity ^0.8.0;
contract Check {
function check0(address[] calldata stuff) external view returns (uint256) {
uint256 startGas = gasleft();
uint256 counter;
for (uint256 i; i< stuff.length; i++) {
counter++;
@z0r0z
z0r0z / CuriaPanel.sol
Created Apr 22, 2022
curia panel reputation / membership protocol
View CuriaPanel.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
@z0r0z
z0r0z / AnyToken.sol
Created Apr 22, 2022
this is a general purpose way to tokenize things, anything, really
View AnyToken.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
@z0r0z
z0r0z / RentNFT.sol
Created Apr 4, 2022
pay rent to keep right to hold an NFT
View RentNFT.sol
// 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";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol";
import "https://github.com/Rari-Capital/solmate/blob/main/src/utils/SafeTransferLib.sol";
contract RentNFT is ERC721("RentNFT", "RENT"), Ownable {
using SafeTransferLib for address;
@z0r0z
z0r0z / LilSuperfluidNFT.sol
Created Mar 12, 2022
A simple token streaming manager represented by NFTs
View LilSuperfluidNFT.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.10;
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol';
import 'https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC721.sol';
/// @title lil superfluid nft
/// @author Miguel Piedrafita, Ross Campbell
/// modified from (https://github.com/m1guelpf/lil-web3/blob/main/src/LilSuperfluid.sol)
/// @notice A simple token streaming manager represented by NFTs
View AfterExpensesPaymentSplitter.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (finance/PaymentSplitter.sol)
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Context.sol";
/**
@z0r0z
z0r0z / MultiToken.sol
Last active Feb 28, 2022
what ERC-1155 could have been
View MultiToken.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient MultiToken implementation adhering as closely to ERC20 interface.
/// @author Ross, modified from (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC20.sol)
abstract contract MultiToken {
/*///////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/