Skip to content

Instantly share code, notes, and snippets.

Avatar

Dennison Bertram crazyrabbitLTC

View GitHub Profile
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",
View gist:6cc36627e6e574159b72e690679d9bd9
{
accounts(orderBy:tokenReceivedAmountAverage orderDirection: desc){
id
tokenBalance
tokenTransferAmountAverage
}
}
@crazyrabbitLTC
crazyrabbitLTC / Governor Alpha
Created Dec 2, 2020
Compound Style Governance for Tally Rinkeby
View Governor Alpha
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Compound Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 400000e18; }