Skip to content

Instantly share code, notes, and snippets.

Ian Monk ianmonkuk

View GitHub Profile
View underlying.sol
pragma solidity ^0.4.8;
contract Underlying {
string public name;
string public symbol;
address public owner;
string public category;
struct KPILink {
address KPI;
View myproject-index.html
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./app.js"></script>
<script>
window.onload = function() {
console.log( "Account" + web3.eth.accounts[2] );
MetaCoin.deployed().then(function(instance) {
return instance.getBalance.call(web3.eth.accounts[2]);
View truffleContract-index.html
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./bower_components/web3/dist/web3.min.js"></script>
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="./javascript/truffle-contract/dist/truffle-contract.js"></script>
<script>
window.onload = function() {
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
View MetaCoin.sol
pragma solidity ^0.4.4;
import "./ConvertLib.sol";
contract MetaCoin {
mapping (address => uint) balances;
address originAddress;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function MetaCoin() {
balances[tx.origin] = 10000;
View index.html
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./app.js"></script>
<script>
window.onload = function() {
console.log( "Account" + web3.eth.accounts[2] );
View truffle.js
var DefaultBuilder = require("truffle-default-builder");
module.exports = {
build: new DefaultBuilder({
"index.html": "index.html",
"app.js": [
"javascripts/app.js"
],
"app.css": [
"stylesheets/app.css"
View index.html
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./bower_components/web3/dist/web3.min.js"></script>
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="./javascript/truffle-contract/dist/truffle-contract.js"></script>
<script>
window.onload = function() {
if (typeof web3 !== 'undefined') {
View gist:5e39a3705c576710b196fee48f7ff68d
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./bower_components/web3/dist/web3.min.js"></script>
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.js"></script>
<script>
window.onload = function() {
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
View index.html
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="./bower_components/web3/dist/web3.min.js"></script>
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.js"></script>
<script>
window.onload = function() {
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
View truffle-contract.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
var ethJSABI = require("ethjs-abi");
var BlockchainUtils = require("truffle-blockchain-utils");
var Web3 = require("web3");
// For browserified version. If browserify gave us an empty version,
// look for the one provided by the user.
if (typeof Web3 == "object" && Object.keys(Web3).length == 0) {
Web3 = global.Web3;
You can’t perform that action at this time.