Skip to content

Instantly share code, notes, and snippets.

Avatar

drandreaskrueger

View GitHub Profile
@drandreaskrueger
drandreaskrueger / compose_sign_and_send_extrinsic(substrate)
Last active Jun 25, 2020
compose_sign_and_send_extrinsic(substrate) - both results (bottom) done with rc3 - added python @quickstart - cleaned up, new scalecodec version
View compose_sign_and_send_extrinsic(substrate)
#!/usr/bin/env python3
"""
@summary: Send extrinsic - how to? Example doesn't work yet for substrate & node-template.
For reporting in https://github.com/polkascan/py-substrate-interface/issues/14
Output RESULTS = see bottom of this file
@version: v05 (25/June/2020)
@since: 10/June/2020
@author: https://github.com/drandreaskrueger
@see: https://github.com/drandreaskrueger/chainhammer-substrate for updates
@drandreaskrueger
drandreaskrueger / energywebfoundation_ew-origin_allContracts-b724754.sol
Created Sep 11, 2018
ordered concatenation of all 20 solidity contracts at https://github.com/energywebfoundation/ew-origin/tree/master/contracts on 2018 September 11th (Latest commit b724754 on Jul 31)
View energywebfoundation_ew-origin_allContracts-b724754.sol
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ordered concatenation of all 20 solidity contracts at
// https://github.com/energywebfoundation/ew-origin/tree/master/contracts
// on 2018 September 11th (Latest commit b724754 on Jul 31)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@drandreaskrueger
drandreaskrueger / requirements_unversioned.txt
Created Jun 18, 2018
same dependencies as your requirements.txt but without version numbers
View requirements_unversioned.txt
asn1crypto
attrdict
bcrypt
certifi
cffi
chardet
colorlog
cryptography
cytoolz
eth-abi
@drandreaskrueger
drandreaskrueger / deployContract_example_web3_bugfix-for-quorum.py
Created Jun 18, 2018
the default web3.py example to deploy contracts, bugfixed for Quorum 2.0.2 (Geth v1.7.2 fork)
View deployContract_example_web3_bugfix-for-quorum.py
# taken from
# http://web3py.readthedocs.io/en/stable/contracts.html#contract-deployment-example
#
# then repaired:
# see issue 808 https://github.com/ethereum/web3.py/issues/808
# and extended
#
# and quorum-bugfixed, see
# https://github.com/ethereum/web3.py/issues/898#issuecomment-396701172
@drandreaskrueger
drandreaskrueger / deployContract_example_web3.py
Last active Jun 12, 2018
the default web3.py example how to deploy contracts does not work on Quorum (Geth v1.7.2 fork)
View deployContract_example_web3.py
# taken from
# http://web3py.readthedocs.io/en/stable/contracts.html#contract-deployment-example
#
# then repaired:
# see issue 808 https://github.com/ethereum/web3.py/issues/808
# and slightly extended
#
# purpose:
# see issue 898 https://github.com/ethereum/web3.py/issues/898
@drandreaskrueger
drandreaskrueger / glances
Created Jan 8, 2018
glances init.d script - does not work ... yet
View glances
#! /bin/sh
### BEGIN INIT INFO
# Provides: glances
# chkconfig: 2345 80 80
# Short-Description: Start and stop the Glances server
### END INIT INFO
##############
######### from https://github.com/moumoul/scripting/blob/master/initd/glances
@drandreaskrueger
drandreaskrueger / freemind-install.sh
Last active Feb 8, 2018
installs freemind on Debian stretch(testing) - almost works, some issues, have asked in freemind sourceforge forum - https://sourceforge.net/p/freemind/discussion/22102/thread/8ee5e81f/
View freemind-install.sh
# distro can be one of experimental, unstable, testing or ubuntu.
DISTRO=testing
echo
echo install freemind
echo script by Andreas Krueger 2017, version v01
echo
echo must be run as root:
echo
@drandreaskrueger
drandreaskrueger / ethereum_debian8.txt
Last active Jan 12, 2021
Debian 8 - ethereum and eth-dev-tools - installation manual
View ethereum_debian8.txt
#
# Ethereum and eth-dev-tools: Debian 8
#
# rev 9
#
# started midsummer 2016-06-21 Andreas Krueger
# https://github.com/drandreaskrueger
# https://twitter.com/drandreaskruger
# please contact me with improvements, thanks.
#
@drandreaskrueger
drandreaskrueger / Scanning Live Ethereum Contracts for the "Unchecked-Send" Bug - suggestion for listing 3
Created Jun 18, 2016
Scanning Live Ethereum Contracts for the "Unchecked-Send" Bug - suggestion for listing 3
View Scanning Live Ethereum Contracts for the "Unchecked-Send" Bug - suggestion for listing 3
/*** Listing 3 - would this be an improvement? ***/
/*** ***/
/*** inspired by excellent article ***/
/*** http://hackingdistributed.com/2016/06/16/scanning-live-ethereum-contracts-for-bugs ***/
if (gameHasEnded && !( prizePaidOutToWinner ) ) {
if (winner.send(1000))
prizePaidOutToWinner = True;
}