Skip to content

Instantly share code, notes, and snippets.

Avatar

Dennison Bertram crazyrabbitLTC

View GitHub Profile
@crazyrabbitLTC
crazyrabbitLTC / NFT Roles.sol
Last active Oct 5, 2022
NFT Roles description
View NFT Roles.sol
// SPDX-License-Identifier: MIT
// by dennison@tally.xyz
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
contract Roles is ERC1155, AccessControl {
// errors
error NoDuplicateRoles();
@crazyrabbitLTC
crazyrabbitLTC / Ethereum registry Decoded.sol
Created Sep 30, 2022
Decoding the Oldest Ethereum Registry interface
View Ethereum registry Decoded.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ABI_0x5564886ca2C518d1964E5FCea4f423b41Db9F561 {
function name(address) external;
function owner(bytes32) external;
function content(bytes32) external;
function addr(bytes32) external;
function reserve(bytes32) external;
function subRegistrar(bytes32) external;
View Complete SoulBound Token Example
// SPDX-License-Identifier: MIT
pragma solidity ^ 0.8 .4;
// Made with Love by Dennison Bertram @Tally.xyz
import "@openzeppelin/contracts@4.6.0/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.6.0/access/Ownable.sol";
import "@openzeppelin/contracts@4.6.0/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC721/extensions/draft-ERC721Votes.sol";
import "@openzeppelin/contracts@4.6.0/utils/Counters.sol";
contract MyToken is ERC721, Ownable, EIP712, ERC721Votes {
View Fixed _beforeTokenTransfer hook
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal override(ERC721, ERC721Votes)
{
require(from == address(0), "Err: token is SOUL BOUND");
super._beforeTokenTransfer(from, to, tokenId);
}
}
View Broken _beforeTokenTransfer hook
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal override(ERC721, ERC721Votes)
{
require(true == false, "Err: token is SOUL BOUND");
super._beforeTokenTransfer(from, to, tokenId);
}
}
@crazyrabbitLTC
crazyrabbitLTC / SoulBoundTokenExample.sol
Created May 27, 2022
An example Soul Bound Token for Governance
View SoulBoundTokenExample.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// Made with Love by Dennison Bertram @Tally.xyz
import "@openzeppelin/contracts@4.6.0/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.6.0/access/Ownable.sol";
import "@openzeppelin/contracts@4.6.0/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC721/extensions/draft-ERC721Votes.sol";
import "@openzeppelin/contracts@4.6.0/utils/Counters.sol";
View attestation.txt
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 125
Hash: 6d26febd 173f9e51 b1ac3fb1 0d8b710f
d70cbe9c 4a1a0122 2c541bf1 041b717d
59064417 737f9736 26acd89f ff20ef6e
d5808ec7 ee6f2fc6 b8c41822 f00597bb
View token.abi.json
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
View Coin Gecko Token List March 1, 2021
[
{
"id": "",
"symbol": "can",
"name": "Channels",
"platforms": { "huobi-token": "0x1e6395e6b059fc97a4dda925b6c5ebf19e05c69f" }
},
{ "id": "01coin", "symbol": "zoc", "name": "01coin", "platforms": {} },
{
"id": "0-5x-long-algorand-token",