Skip to content

Instantly share code, notes, and snippets.

View Hamzaahmed742's full-sized avatar
✌️

hamzaahmed742 Hamzaahmed742

✌️
View GitHub Profile

Answers to Deep Questions about Solidity

The following list of questions was taken from https://www.reddit.com/r/ethereum/comments/72reba/do_you_have_deep_questions_about_solidity_or_the/

An updated summary on the different ways one could have two contracts interact (DELEGATECALL, STATICCALL, libraries, all that stuff) with clear pros/cons for each (gas cost, whether it requires EVM assembly directives, etc)

Question by /u/drcode

I won't talk about low-level opcodes here because of the brevity of the answer. In general, there are four ways functions can be called in Solidity:

@Hamzaahmed742
Hamzaahmed742 / Object Flatten
Created February 19, 2019 07:52 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
@Hamzaahmed742
Hamzaahmed742 / Airdrop Script
Last active January 29, 2019 03:05
Airdrop script compatible only with ERC644 and use Couchbase as the DB
const express = require('express')
var couchbase = require('couchbase')
var cluster = new couchbase.Cluster('couchbase://ip/');
cluster.authenticate('Username', 'password');
var TokenLab_bucket = cluster.openBucket('bucket name')
var Snapshot_bucket = cluster.openBucket('bucket name')
var Web3 = require('web3');
const fs = require('fs');
var keythereum = require("keythereum");
var key = require('./UTC.json');
@Hamzaahmed742
Hamzaahmed742 / README.md
Created December 24, 2018 20:47 — forked from luciopaiva/_Full-socketio-client-and-server-example.md
Full socket.io client and server example

Full socket.io client and server example

To see a full explanation, read my answer on SO here: https://stackoverflow.com/a/24232050/778272.

How to use

Create a folder, run npm init -f on it and paste both server.js and client.js there (see files below). Needless to say, you must have Node.js installed on your system.

Install the required libraries: