This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
node-webserver: | |
description: A test node webserver | |
start: bin/node_server | |
caps: | |
- networking | |
- ethereum_ipc | |
binaries: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: AppArmor security policy for clients using the ethereum framework via IPC | |
# Usage: reserved | |
# | |
# read and write to the unix socket opened by the client | |
/var/lib/apps/ethereum/*/.ethereum/geth.ipc rw, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var amounts = $amounts; | |
var dao = web3.eth.contract($dao_abi).at('$dao_address'); | |
console.log("Buying DAO tokens"); | |
for (i = 0; i < eth.accounts.length; i++) { | |
web3.eth.sendTransaction({ | |
from:eth.accounts[i], | |
to: dao.address, | |
gas:200000, | |
value:web3.toWei(amounts[i], "ether") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// since funding failed let's get a refund | |
var eth_balance_before_refund = []; | |
for (i = 0; i < eth.accounts.length; i++) { | |
eth_balance_before_refund.push(web3.fromWei(eth.getBalance(eth.accounts[i]))); | |
} | |
addToTest('eth_balance_before_refund', eth_balance_before_refund); | |
for (i = 0; i < eth.accounts.length; i++) { | |
dao.refund.sendTransaction({ | |
from:eth.accounts[i], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eth_balance_after_refund = []; | |
for (i = 0; i < eth.accounts.length; i++) { | |
eth_balance_after_refund.push(web3.fromWei(eth.getBalance(eth.accounts[i]))); | |
} | |
addToTest('eth_balance_after_refund', eth_balance_after_refund); | |
var refund = []; | |
for (i = 0; i < eth.accounts.length; i++) { | |
refund.push((bigDiffRound( | |
testMap['eth_balance_after_refund'][i], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run(ctx): | |
ctx.assert_scenario_ran('deploy') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
accounts_num = len(ctx.accounts) | |
sale_secs = ctx.remaining_time() | |
ctx.total_supply = random.randint(5, ctx.args.deploy_min_value - 4) | |
ctx.token_amounts = constrained_sum_sample_pos( | |
accounts_num, ctx.total_supply | |
) | |
ctx.create_js_file(substitutions={ | |
"dao_abi": ctx.dao_abi, | |
"dao_address": ctx.dao_addr, | |
"wait_ms": (sale_secs-3)*1000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctx.execute(expected={ | |
"dao_funded": False, | |
"total_supply": ctx.total_supply, | |
"refund": ctx.token_amounts | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
out_to_x no | |
own_window no | |
out_to_console yes | |
background no | |
max_text_width 0 | |
# Update interval in seconds | |
update_interval 2.0 | |
# This is the number of times Conky will update before quitting. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import argparse | |
def min_quorum(args): | |
total_supply = args.supply | |
div = args.div | |
actual_balance = args.balance | |
value = args.val |