Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / runTestRpc.sh
Created March 14, 2017 11:53
Starts RPC with a few funded accounts
#!/bin/bash
testrpc -m "leader forget bracket nominee flower knock animal noise tourist mesh very blush" \
--account="0xa1580e62b21b7c2f79cbfd7c755ef459bf5eb6b140e2a22a4e7aed48e03198a3,10000000000000000000000000" --account="0x5c5fe9067b077a2706351ff0f4e1b59b19d526da77a1875b916849030a9e75da,20000000000000000000000000" --account="0x33a844a8bc4d8428528e7a3198fc0bb438a933ce77df430d86eee79a5e44fff8,30000000000000000000000000" --account="0x52f2129266c24d8d81b38c38e8410388778aa66181a75016332716df8c0f66fb,40000000000000000000000000" --account="0x43c1aa08e6ee114f1fb21f4ed04084def5d761e4cb4e95beaf6c22fb5320f88c,50000000000000000000000000" --account="0x407d3445c156d25f6e68fdd2696db1e4ba450e668aca271189c10eef0d3f55cd,60000000000000000000000000" --account="0xdb68011191f47133e210bf69f9691f4f57fb91af4ad9cb43224e4f75ac292200,100000000000000000000000000"
# leader forget bracket nominee flower knock animal noise tourist mesh very blush
# ignore this for now...
# salute sting tuna liberty beauty correct tilt stomach gain v
@cicorias
cicorias / Sending raw
Created March 15, 2017 04:19
Send raw ethereum tx
Skip to content
This repository
Pull requests
Issues
Gist
@cicorias
Watch 81
Unstar 610
Fork 264 ethereum/web3.js
Code Issues 144 Pull requests 10 Projects 1 Wiki Pulse Graphs
@cicorias
cicorias / Sending raw
Created March 15, 2017 04:19
Send raw ethereum tx
Skip to content
This repository
Pull requests
Issues
Gist
@cicorias
Watch 81
Unstar 610
Fork 264 ethereum/web3.js
Code Issues 144 Pull requests 10 Projects 1 Wiki Pulse Graphs
contract EternalStorage{
mapping(bytes32 => uint) UIntStorage;
function getUIntValue(bytes32 record) constant returns (uint){
return UIntStorage[record];
}
function setUIntValue(bytes32 record, uint value)
{
import "EternalStorage.sol";
library ProposalsLibrary {
function getProposalCount(address _storageContract) constant returns(uint256)
{
return EternalStorage(_storageContract).getUIntValue(sha3("ProposalCount"));
}
function addProposal(address _storageContract, bytes32 _name)
import "ProposalsLibrary.sol";
contract Organisation
{
using ProposalsLibrary for address;
address public eternalStorage;
function Organisation(address _eternalStorage) {
eternalStorage = _eternalStorage;
}
import "ITokenLedger.sol";
contract Organisation
{
ITokenLedger public tokenLedger;
function Organisation(address _tokenLedger) {
tokenLedger = ITokenLedger(_tokenLedger);
}
contract ITokenLedger {
function generateTokens(uint256 _amount) {}
}
contract TokenLedger {
uint256 total_supply;
mapping (address => uint256) balances;
function generateTokens(uint256 _amount)
import "ITokenLedger.sol";
import "ProposalsLibrary.sol";
contract Organisation
{
ITokenLedger public tokenLedger;
using ProposalsLibrary for address;
address public eternalStorage;
function Organisation(address _tokenLedger, address _eternalStorage) {
import "Organisation.sol";
import "TokenLedger.sol";
import "EternalStorage.sol";
contract Parent {
event OrganisationCreated(address organisation, uint now);
event OrganisationUpgraded(address organisation, uint now);
mapping(bytes32 => address) public organisations;