Skip to content

Instantly share code, notes, and snippets.

View crazyrabbitLTC's full-sized avatar

Dennison Bertram crazyrabbitLTC

View GitHub Profile
@crazyrabbitLTC
crazyrabbitLTC / SolidityLinkedList.sol
Created November 28, 2018 18:46
Basic LinkedList for Solidity
pragma solidity ^0.4.24;
contract LinkedList {
event AddEntry(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
bytes32 next;
string data;
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
[
{
"id": "",
"symbol": "can",
"name": "Channels",
"platforms": { "huobi-token": "0x1e6395e6b059fc97a4dda925b6c5ebf19e05c69f" }
},
{ "id": "01coin", "symbol": "zoc", "name": "01coin", "platforms": {} },
{
"id": "0-5x-long-algorand-token",
{
accounts(orderBy:tokenReceivedAmountAverage orderDirection: desc){
id
tokenBalance
tokenTransferAmountAverage
}
}
@crazyrabbitLTC
crazyrabbitLTC / Governor Alpha
Created December 2, 2020 20:49
Compound Style Governance for Tally Rinkeby
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; }
@crazyrabbitLTC
crazyrabbitLTC / TOMP
Created December 2, 2020 20:48
Compound Style Governance Token (TOMP) Tally Comp
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract Comp {
/// @notice EIP-20 token name for this token
string public constant name = "Compound";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "TOMP";
//Verified// ✓ Deployed instance of GovernorDeployer 0xf3d1493e6c668573e5556A3CfF9ccd4f0A4C6B65
✓ Deployed instance of GovernanceTokenDeployer 0x897295E60Ba26669b5714efdC42864ffD0a876d0
✓ Deployed instance of TimelockDeployer 0x9e842f5CdfDE63D942FD1400D24dD83948367962
✓ Deployed instance of GovernanceFactory 0x3710D59F1Be10Eeb352bd03afD9A81d7Bf0bF8F5 //Verified//
2_deploy_factory.js
===================
GovernorDeployer Address: 0x288Bba7F0b46d2eD7c6902b59d2aA487839Ce27c
TimelockDeployer Address: 0xC80f277c480a1C3745BeD7dA4Ef6627f84d236E7
GovernanceTokenDeployer Address: 0x6F585007f3206FcEf499d4858BC7932F9DAB957B
GovernanceFactory Address: 0xbec4ee9B439cc51f1a9F3b7418ae210A9092368d
Gists to flattened code:
// File: contracts/CompoundContracts/GovernorAlpha.sol
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public name;
// File: contracts/CompoundContracts/SafeMath.sol
pragma solidity ^0.5.16;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow