Skip to content

Instantly share code, notes, and snippets.

@crazyrabbitLTC
Created December 5, 2018 04:39
Show Gist options
  • Save crazyrabbitLTC/19eba18bb25588dbb20d444e6de5a086 to your computer and use it in GitHub Desktop.
Save crazyrabbitLTC/19eba18bb25588dbb20d444e6de5a086 to your computer and use it in GitHub Desktop.
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");
_linkedlist = linkedlist;
}
function getHead() public view returns (bytes32) {
bytes32 _node = _linkedlist.head();
return _node;
}
function addNode(string _data) public {
_linkedlist.addNode(_data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment