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;
@crazyrabbitLTC
crazyrabbitLTC / SolidityLinkedList.sol
Created November 28, 2018 19:56
SolidityLinkedListv.02 - improved
pragma solidity ^0.4.24;
import "zos-lib/contracts/Initializable.sol";
contract LinkedList is Initializable {
event AddEntry(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
@crazyrabbitLTC
crazyrabbitLTC / LinkedList.sol
Created December 1, 2018 20:32
SolidityLinkedList
pragma solidity ^0.4.24;
import "zos-lib/contracts/Initializable.sol";
contract LinkedList is Initializable {
event AddEntry(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
@crazyrabbitLTC
crazyrabbitLTC / linkedlist.sol
Created December 5, 2018 00:03
ZeppelinOS - LinkedList Tutorial code
pragma solidity ^0.4.24;
import "zos-lib/contracts/Initializable.sol";
contract LinkedList is Initializable {
event AddEntry(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
@crazyrabbitLTC
crazyrabbitLTC / QuickContract.sol
Created December 5, 2018 04:39
A contract to demonstrate linking to our Linked List Contract
pragma solidity ^0.4.24;
import "dennison-linkedlist/contracts/LinkedList.sol";
contract QuickContract {
LinkedList private _linkedlist;
function setLinkedList(LinkedList linkedlist) external {
require(linkedlist != address(0), "You must provide a non-0x0 address");
@crazyrabbitLTC
crazyrabbitLTC / StringToLower.sol
Created January 16, 2019 14:15 — forked from ottodevs/StringToLower.sol
Ethereum/Solidity toLower() equivalent, to transform strings to lowercase
pragma solidity ^0.4.11;
contract StringToLower {
function _toLower(string str) internal returns (string) {
bytes memory bStr = bytes(str);
bytes memory bLower = new bytes(bStr.length);
for (uint i = 0; i < bStr.length; i++) {
// Uppercase character...
if ((bStr[i] >= 65) && (bStr[i] <= 90)) {
// So we add 32 to make it lowercase
@crazyrabbitLTC
crazyrabbitLTC / LinkedList.sol
Created January 17, 2019 16:01
LinkedList upgraded to Solidity v5
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
contract LinkedList is Initializable{
event AddEntry(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
pragma solidity ^0.5.0;
//import "zos-lib/contracts/Initializable.sol";
//contract LinkedList is Initializable{
contract LinkedList {
event EntryAdded(bytes32 head, string data, bytes32 next);
//Struct will be our Node
@crazyrabbitLTC
crazyrabbitLTC / LinkedList.sol
Last active January 18, 2019 21:18
LinkedList educational EVM package in Solidity v5.
pragma solidity >=0.4.24 <0.6.0;
import "zos-lib/contracts/Initializable.sol";
contract LinkedList is Initializable{
event EntryAdded(bytes32 head, string data, bytes32 next);
//Struct will be our Node
struct Node {
@crazyrabbitLTC
crazyrabbitLTC / QuickContract.sol
Created January 22, 2019 15:49
QuickContract.sol - ZeppelinOS Tutorial Demo Contract
pragma solidity >=0.4.24 <0.6.0;
import "zos-linkedlist/contracts/LinkedList.sol";
//The NPM package name will have it's own folder under modules
contract QuickContract {
LinkedList private _linkedlist;
function setLinkedList(LinkedList linkedlist) external {
_linkedlist = linkedlist;
}