Skip to content

Instantly share code, notes, and snippets.

View furusiyya's full-sized avatar

Bilal furusiyya

View GitHub Profile
/**
* NTRY Cointract contract, ERC20 compliant (see https://github.com/ethereum/EIPs/issues/20)
*
* Code is based on multiple sources:
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20.sol
* https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Token.sol
*/
pragma solidity ^0.4.8;
@furusiyya
furusiyya / id_rsa.pub
Last active April 16, 2018 14:18
ssh rsa public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDg79655A0KOegZ1ohn7IcvkIYFJj4TbWPAHhZivBDbZdVTfI7fSzO32uP0XsibrxNv5054XVEUPYcm8TXIlH9clqippnyjdWM9vAXCfrB7xE7poQ9rz4e7rdIPcU/lMtI4N0iOL3lyawkzHsSHPLAozIr+fHua5Vg+dud1JeUers2EG+kxAnPPK6iPV1vqgIWKoL5nTogLu7iCDoCqY6MIWdz7CSzv9uoyYqqqrVN8sj0wfwJEIsmkR1ep0wlNtMajx2CoA4PvfDsa5ReVTop2vELcoHrrGu0EkbK+4UmcUmvMdCPLAs3SvF5r8k201eTxPw5NIAc5pi5mHAkQBX+H fsociety@fsociety
@furusiyya
furusiyya / client.go
Created June 1, 2017 12:48
Client I used stress testing of my server
package main
import (
"bufio"
"fmt"
"net"
"os"
"strconv"
"time"
)
/**
* Beth token contract, ERC20 compliant (see https://github.com/ethereum/EIPs/issues/20)
*
* Code is based on multiple sources:
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20.sol
* https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts/Token.sol
*/
pragma solidity ^0.4.8;
investors[0x8ceda3f1bd005a5e30b5cb269ce8bf86b5b96c20] = 1131588360000000000
investors[0x39346183c258d1ba55eb4cd7ed2822dfeffe38f5] = 4000000000000000000
investors[0x6fd623ab0dff084df49975986ad8af7c306bf8b8] = 600000000000000000
investors[0xab4bf37461f081c369175b4bee5ae22ea9f7e980] = 12000000000000000
investors[0xaff4ac0f844d2efba41745ed6c76907200be88f2] = 2000000000000000000
investors[0x4a2dccbc65ba28796af0a15dd11424c14153d2d1] = 100000000000000000
investors[0xccc8d4410a825f3644d3a5bbc0e9df4ac6b491b3] = 472856928000000000
investors[0x03e7d38a76d478c6a9edc2386fcd7e2983309b6c] = 100000000000000000
investors[0x98175430c3a4bd4d577e18b487b3ed7303e2c52d] = 10000000000000000000
investors[0x742eacb804428d576d4926fe71af712b430eb644] = 22000000000000000
@furusiyya
furusiyya / AuditReview.md
Last active July 17, 2017 12:39
ForecasterReward audit review

Note: No critical issue found that can cause loss of funds or locking of funds.

Section 5 - Audit findings

5.1 Note Issues

5.1.1 Event parameters not indexed

Type: Enhancement
Status: fixed
Comment: Indexed parameters are used for searching logs. Contract was no relying on logs but store records explicitly in

/**
* Asset Token contract, ERC20 compliant (see https://github.com/ethereum/EIPs/issues/20)
*
* Code is based on multiple sources:
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts
* https://github.com/TokenMarketNet/ico/blob/master/contracts
* https://github.com/ConsenSys/Tokens/blob/master/Token_Contracts/contracts
*/
pragma solidity ^0.4.13;
@furusiyya
furusiyya / ecverify.sol
Created July 27, 2017 21:11 — forked from axic/ecverify.sol
Ethereum ECVerify
//
// The new assembly support in Solidity makes writing helpers easy.
// Many have complained how complex it is to use `ecrecover`, especially in conjunction
// with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call.
//
// Sample input parameters:
// (with v=0)
// "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad",
// "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200",
// "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a"

Setup should be followed one section after another.

For example you may need to set up 2 miners and 2 non-miners. You follow once through, (assuming it's tabula rasa state) Starting new Network, then Adding mining/signing node to existing network, then twice Adding non mining/signing node to existing network, after you've done it you should manually (for the purpose of testing) run: firstly run bootnode, then all other nodes. If you see that everyone is in sync (block mining appears on every one of them) you can prepare services for each of them.

Starting new network

Creating workplace

We will create a folder /home/cryptodaemon/poaGethNode and folder for blockchain database /home/cryptodaemon/poaGethNode/node mkdir -p /home/cryptodaemon/poaGethNode/node
Download PoA Geth binary and put it into /home/cryptodaemon/poaGethNode

Rename binary to geth

(warning) If you doing adding just another node, you do should skip this.

@furusiyya
furusiyya / Submission.md
Created August 28, 2017 17:04
Project: Glutton (https://github.com/mushorg/glutton) - Google Summer of Code 2017 final submission report

Merged Pull Requests

Issues Resolved: #72, #59
Description Glutton support number of services (protocol handlers) so each service mean number of connection on that service. So It crash after some time with error: [user.tcp] accept tcp [::]:5000: accept4: too many open files, and this error was due to the allowance of limited number of open file descriptors by the operating system. There was no deadline set for opened connections so most of the connections never get closed. In result, the number of opened connections gradually cross the maximum open file descriptors limit and cause panic. So I added connection timeout = 72 second, number of opened connection will never reach the open file descriptor limit. Another reason was Freki; Glutton useses freki as a networking core so frek