Skip to content

Instantly share code, notes, and snippets.

View ayinot's full-sized avatar

skygirl ayinot

  • Singapore
View GitHub Profile
anonymous
anonymous / MappedStructsWithIndex.sol
Created February 14, 2018 09:08
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
contract MappedStructsWithIndex {
struct EntityStruct {
uint entityData;
bool isEntity;
}
mapping(address => EntityStruct) public entityStructs;
address[] public entityList;
anonymous
anonymous / Bid.sol
Created February 8, 2018 09:03
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=false&gist=
pragma solidity ^0.4.2;
contract Bid {
// Declaring all variables
string businessname ;
string businessaddress ;
string industrytype;
string industrysubtype;
string description;
anonymous
anonymous / AddressArray.sol
Created November 23, 2017 12:55
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=undefined&gist=
pragma solidity ^0.4.2;
contract AddressArray {
address admin;
string businessName ;
string businessAddress ;
string industryType;
string industrySubType;
address[] intermediaryaddresses;
Bid[] public bids;
$(".new-goods-submit-button").on('click',function(){
console.log('submitting goood');
//get hash of the good
var file_unique_hash = $("#good_file_input").data('uniquehash');
var file_name = "canoe";
var file_description = "a wooden boat";
@chriseth
chriseth / contract.sol
Created June 4, 2015 13:17
Solidity decimal conversion
contract c {
uint a;
function charAt(bytes32 b, uint char) returns (bytes1) {
return bytes1(uint8(uint(b) / (2**((31 - char) * 8))));
}
function parseDecimal(bytes32 byteString) returns (uint r) {
uint n = uint(byteString);
for (uint b = 0; b < 32; b ++)
{
var c = uint8(charAt(byteString, b));
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream