Coder Social home page Coder Social logo

etherex / etherex Goto Github PK

View Code? Open in Web Editor NEW
602.0 83.0 215.0 13.12 MB

EtherEx is an open source, fully transparent, next generation decentralized exchange built on Ethereum.

Home Page: http://etherex.github.io/etherex

License: MIT License

JavaScript 86.53% CSS 3.16% HTML 0.09% Python 10.22%

etherex's Introduction

EtherEx

Build Status Dependency Status devDependency Status SlackIn Join the chat at https://gitter.im/etherex/etherex

Decentralized exchange built on Ethereum.

About

This repository contains the source code that runs the exchange on Ethereum as a set of contracts, along with the UI, tests, tools and documentation.

Components

  • contracts: Ethereum contracts in Serpent
  • frontend: React.js UI
  • tests: EtherEx tests

Requirements

Installation

Start by cloning this repository.

git clone https://github.com/etherex/etherex.git

Development / testing

This will install pyethereum and ethereum-serpent if you don't already have those installed.

pip install -r dev_requirements.txt

Running tests

py.test -vvrs

Refer to Serpent and pyethereum for their respective usage.

UI development

You will need a working node.js setup (instructions) and globally installed grunt-cli (instructions).

cd frontend
npm install
grunt

And open http://localhost:8089/ in your browser.

Deployment

Requires a local client (Go or C++) with JSONRPC, Serpent and PyEPM

cd contracts
pyepm EtherEx.yaml

API

  • The API is the format of the data field for the Ethereum transactions.
  • Subcurrencies need to support the Subcurrency API.
  • You only need an Ethereum client to use the API.

Operations

Methods (with serpent type definitions):

[
  price:[int256]:int256,
  buy:[int256,int256,int256]:int256,
  sell:[int256,int256,int256]:int256,
  trade:[int256,int256[]]:int256,
  cancel:[int256]:int256,
  deposit:[int256,int256]:int256,
  withdraw:[int256,int256]:int256,
  add_market:[int256,int256,int256,int256,int256,int256]:int256,
  get_market_id:[int256]:int256,
  get_market_id_by_name:[int256]:int256,
  get_last_market_id:[]:int256,
  get_market:[int256]:int256[],
  get_trade:[int256]:int256[],
  get_trade_ids:[int256]:int256[],
  get_sub_balance:[int256,int256]:int256[]
]

Price API

price(market_id)

Trade API

Add buy / sell trade

buy(amount, price, market_id)
sell(amount, price, market_id)

Trade

trade(max_amount, trade_ids)

Deposit

deposit(amount, market_id)

Withdraw

withdraw(amount, market_id)

Cancel trade

cancel(trade_id)

Adding a market

add_market(currency_name, contract_address, decimal_precision, price_denominator, minimum_total, category)

Getting a market's ID by contract address

get_market_id(contract_address)

Getting a market's ID by name

get_market_id_by_name(name)

Market names

Market names follow the "/ETH" convention. When registering a new market, submit the currency name as a three or four letter uppercase identifier, ex.: "BOB" for BobCoin.

Contract address

The subcurrency contract address.

Decimal precision

The subcurrency's decimal precision as an integer.

Price denominator

  • Denominator for price precision, ex. 10000 (10000 => 1 / 10000 => 0.0001)

Minimum trade total

When adding a subcurrency, set the minimum trade total high enough to make economic sense. A minimum of 10 ETH (1000000000000000000000 wei) is recommended.

Categories

1 = Subcurrencies
2 = Crypto-currencies
3 = Real-world assets
4 = Fiat currencies

EtherEx allows you to categorize your subcurrency into four main categories. Since everything is represented as subcurrencies, those categories are simply for convenience. If you have a DApp that has its own token, that would go in the regular subcurrency section 1. If your token represents a fiat currency redeemable at a gateway, add it to 4. If your token represents a real-world asset like gold or a car, add it to 3. For other crypto-currencies like BTC, also redeemable at a gateway, add it to 2.

Market IDs

1 = ETX/ETH

New market IDs will be created as DAO creators add their subcurrency to the exchange.

Subcurrency API

Subcurrency contracts need to support the Standardized Contract APIs (see current Draft), more specifically the approve, transferFrom and allowance methods for deposits, the transfer method for withdrawals and the balanceOf method for the UI to display the user's balance.

See the example ETX contract for a Serpent implementation, or a Standard Token in Solidity.

After registering the subcurrency using the add_market ABI call, the subcurrency will receive a market_id. You can retrieve the market ID with a call to get_market_id(contract_address).

Deposit support

IMPORTANT: The original deposit technique has been deprecated in favor of the Standardized Contract APIs

To support deposits to EtherEx, your subcurrency needs to implement the approve and transferFrom methods. The former allows a one-time transfer from the user's address by the exchange's contract, while the latter is called from the contract to effectively make that transfer when the user calls the exchange's new deposit method. This allows to securely send a subcurrency's tokens to the exchange's contract while updating the user's available balance at the exchange.

Withdrawal support

If your subcurrency's default method for transferring funds is also named transfer like the standard examples above, with the _to and _value parameters (in that order), then there is nothing else you need to do to support withdrawals from EtherEx to a user's address. Otherwise, you'll need to implement that same transfer method with those two parameters, and "translate" that method call to yours, calling your other method with those parameters, in the order they're expected. You may also have to use tx.origin instead of msg.sender in your method as the latter will return your contract's address.

def transfer(_to, _value):
    return(self.invertedtransfer(_value, _to))

Balance

Subcurrency contracts also need to implement a balanceOf method for the UI to display the user's balance in that contract (also called the subcurrency's wallet).

def balanceOf(_addr):
    return(self.balances[_addr].balance)

Accounts

  • Your Ethereum address is used as your identity

TODO

Architecture

  • Document error codes of return values
  • Implement Wallet section (transactions, balances, etc.) (in progress)
  • Re-implement NameReg support and integration
  • Start the Tools section, find and list ideas
    • subcurrency registration (in progress)
    • subcurrency creation tools/wizard
    • raw transact (?)
    • trading tools (...)
    • ...
  • Use NatSpec
  • Look into how Whisper and Swarm could be used and integrated
  • Start working on X-Chain
  • Update this TODO more frequently
  • Start using GitHub issues instead
  • Better, rock solid tests, and way more of them
  • Total unilateral world takeover

UX/UI

  • Graphs, beautiful graphs
  • Advanced trading features (stoploss, etc.)
  • Animations/transitions
  • Check/clear buttons
  • Wallet design and theming
  • More/new mockups / wireframes
  • More/new design elements
  • Implement new mockups / design elements

License

Released under the MIT License, see LICENSE file.

etherex's People

Contributors

caktux avatar cdetrio avatar debris avatar ethers avatar jorisbontje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

etherex's Issues

Implimenting a small fee (when order executed)

I am trying to implement a small fee (0.001%) when a transaction is executed, could someone try and point me in the right direction, as I am only looking so far to change code in the smart contract.

Thanks, I hope this project is not all dead and that somebody is able to give me a reply.

The Ethereum block chain is not current - Mist 0.8.1

On OSX, In Mist 0.8.1 with the block chain fully up to date on the 'test-net' I get the following error:

Ethereum loading...

The Ethereum block chain is not current and is fetching blocks from 0 peers.

My chain is up to date, and peers are available. Also pressing the 'Load Anyway' button doesn't do anything.

fix naked sends

return value of all send calls should be checked because send will return a 0 when a VM error, such as the 1024 stackdepthlimit is exceeded. However, any code after the send will still be executed (thus the desired behavior may be to only execute the code when send doesn't return 0)

Example of naked send:

send(msg.sender, value)

ETX contract negative amount vulnerability

Calling the ETX contract send function with a negative amount allows you to steal someone else balance. The send function should verify that the amount is positive to prevent this.

Minimal Viable Test :)

from pyethereum import tester

class TestEtxContract(object):

    CONTRACT = 'contracts/etx.se'

    def setup_class(cls):
        cls.s = tester.state()
        cls.c = cls.s.abi_contract(cls.CONTRACT)
        cls.snapshot = cls.s.snapshot()

    def setup_method(self, method):
        self.s.revert(self.snapshot)

    def test_negative_send_should_fail(self):
        assert self.c.send(tester.a0, -1000, sender=tester.k1) == 0
        assert self.c.balance(tester.a0) == 100000000000
        assert self.c.balance(tester.a1) == 0

can't run test with python3

============================================================================= ERRORS ==============================================================================
_____________________________________________________________ ERROR collecting tests/test_etherex.py ______________________________________________________________
/usr/local/lib/python3.5/dist-packages/_pytest/python.py:468: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/local/lib/python3.5/dist-packages/py/_path/local.py:668: in pyimport
import(modname)
E File "/root/etherex/tests/test_etherex.py", line 163
E 584202455294917676171628316407181071088652546483L,
E ^
E SyntaxError: invalid syntax
_______________________________________________________________ ERROR collecting tests/test_etx.py ________________________________________________________________
ImportError while importing test module '/root/etherex/tests/test_etx.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.5/dist-packages/_pytest/python.py:468: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/usr/local/lib/python3.5/dist-packages/py/_path/local.py:668: in pyimport
import(modname)
/usr/local/lib/python3.5/dist-packages/pytest/assertion/rewrite.py:226: in load_module
py.builtin.exec
(co, mod.dict)
tests/test_etx.py:1: in
from ethereum import tester
E ImportError: cannot import name 'tester'

please help

question for etherex.se

Line 292

 # Update balances
 self.balances[self][market_id].trading -= fill
 self.balances[msg.sender][market_id].available += fill

should self be owner?

 # Update balances
 self.balances[owner][market_id].trading -= fill
 self.balances[msg.sender][market_id].available += fill

ERC20 Implementation with ERC721's

I'm trying to use this with a testnet for Ethereum & set the the ETH to an ERC20 contract. I want to be able to exchange this for specific ERC721's if possible. Please let me know if this could be done, thanks.

unit test broken ?

~/etherex$ py.test -rs|more
============================= test session starts ==============================
platform linux2 -- Python 2.7.6, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
rootdir: /home/frederic/etherex, inifile: setup.cfg
plugins: xdist-1.13.1
collected 55 items

tests/test_etherex.py EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
tests/test_etx.py EEEEEEE

==================================== ERRORS ====================================
_________________ ERROR at setup of TestEtherEx.test_creation __________________

self = <class 'test_etherex.TestEtherEx'>

    def setup_class(self):
>       self.state = tester.state()

tests/test_etherex.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python2.7/dist-packages/ethereum/tester.py:136: in __init__
    self.block = b.genesis(self.env, start_alloc=o)
/usr/local/lib/python2.7/dist-packages/ethereum/blocks.py:1372: in genesis
    block = Block(header, [], [], env=env)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Block(#0 f1e66880)>, header = <BlockHeader(#0 f1e66880)>
transaction_list = [], uncles = []
env = <ethereum.config.Env object at 0x7f00decd7e10>, parent = None
making = False

    def __init__(self, header, transaction_list=[], uncles=[], env=None,
                 parent=None, making=False):
        assert isinstance(env, Env), "No Env object given"
        assert isinstance(env.db, BaseDB), "No database object given"
        self.env = env # don't re-set after init
        self.db = env.db
        self.config = env.config

        self.header = header
        self.uncles = uncles

        self.uncles = uncles
        self.suicides = []
        self.logs = []
        self.log_listeners = []
        self.refunds = 0

        self.ether_delta = 0
        self._get_transactions_cache = []

        # Journaling cache for state tree updates
        self.caches = {
            'balance': {},
            'nonce': {},
            'code': {},
            'storage': {},
            'all': {}
        }
        self.journal = []

        if self.number > 0:
            self.ancestor_hashes = [self.prevhash]
        else:
            self.ancestor_hashes = [None] * 256

        # do some consistency checks on parent if given
        if parent:
            if hasattr(parent, 'db') and self.db != parent.db and self.db.db != parent.db:
                raise ValueError("Parent lives in different database")
            if self.prevhash != parent.header.hash:
                raise ValueError("Block's prevhash and parent's hash do not match")
            if self.number != parent.header.number + 1:
                raise ValueError("Block's number is not the successor of its parent number")
            if not check_gaslimit(parent, self.gas_limit):
                raise ValueError("Block's gaslimit is inconsistent with its parent's gaslimit")
            if self.difficulty != calc_difficulty(parent, self.timestamp):
                raise ValueError("Block's difficulty is inconsistent with its parent's difficulty")
            if self.gas_used > self.gas_limit:
                raise ValueError("Gas used exceeds gas limit")
            if self.timestamp <= parent.header.timestamp:
                raise ValueError("Timestamp equal to or before parent")
            if self.timestamp >= 2**256:
                raise ValueError("Timestamp waaaaaaaaaaayy too large")

        for uncle in uncles:
            assert isinstance(uncle, BlockHeader)

        original_values = {
            'gas_used': header.gas_used,
            'timestamp': header.timestamp,
            'difficulty': header.difficulty,
            'uncles_hash': header.uncles_hash,
            'bloom': header.bloom,
>           'header_mutable': self.header.mutable_,
        }
E       AttributeError: 'BlockHeader' object has no attribute 'mutable_'

Syntax error in test_etherex.py

sente:etherex cthomas$ py.test -vvrs
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 3.4.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1 -- /Users/cthomas/.pyenv/versions/3.4.2/bin/python3.4
cachedir: .cache
rootdir: /Users/cthomas/src/etherex, inifile: setup.cfg
plugins: xdist-1.14
collected 0 items / 2 errors

================================================================================================== ERRORS ==================================================================================================
__________________________________________________________________________________ ERROR collecting tests/test_etherex.py __________________________________________________________________________________
../../.pyenv/versions/3.4.2/lib/python3.4/site-packages/_pytest/python.py:611: in _importtestmodule
    mod = self.fspath.pyimport(ensuresyspath=importmode)
../../.pyenv/versions/3.4.2/lib/python3.4/site-packages/py/_path/local.py:650: in pyimport
    __import__(modname)
E     File "/Users/cthomas/src/etherex/tests/test_etherex.py", line 163
E       584202455294917676171628316407181071088652546483L,
E                                                       ^
E   SyntaxError: invalid syntax
____________________________________________________________________________________ ERROR collecting tests/test_etx.py ____________________________________________________________________________________
tests/test_etx.py:1: in <module>
    from ethereum import tester
../../.pyenv/versions/3.4.2/lib/python3.4/site-packages/ethereum/__init__.py:8: in <module>
    import slogging  # noqa
E   ImportError: No module named 'slogging'
========================================================================================= 2 error in 0.10 seconds ==========================================================================================

contract starting with 0 => invalid address

In the function loadMarket, the address is converted from a decimal:

var address = web3.fromDecimal(market[2]);

When the contract address start with 0, it is stripped and the address become invalid.

Failed OPTIONS requests, no communication with local Geth

I tried running my local geth with the command line provided by the app. I can get to http://localhost:8545 in my browser (and see a complaint from geth about not having sent a JSON request). However, the Etherex app can't seem to communicate with my local geth instance. The Chrome inspector net panel shows a bunch of OPTIONS requests, in red with the little red X icon, but with no information about what was received in response (just a call stack when you open up the message).

I'm using the geth executable that ships with Mist 0.3.7.

Trying to run pyepm EtherEx.yaml but getting HTTPConnectionPool(host='127.0.0.1', port=8545): Max retries exceeded with url: /

I am starting my private node using the following geth command:

geth --datadir ~/Library/Ethereum/devnet --ipcpath ~/Library/Ethereum/geth.ipc --mine --etherbase 0x82Ac50716A13B7f08F9cAb371418E08bEFa5D096 --nodiscover --maxpeers 0 --rpc --rpcapi "db,eth,net,web3" --rpccorsdomain "*" --port "30303" --pprofport 6060 --rpcport "8080" --nat "any" --identity "TCorp-PRIVATE-CHAIN" --minerthreads 1 --verbosity 4 --pprof --shh --unlock 0x82Ac50716A13B7f08F9cAb371418E08bEFa5D096

then I am planning to deploy your wondering contracts..... no idea really what Im upto but....

13inch:contracts tom$ pyepm EtherEx.yaml

PyEPM 1.0.2

Deploying EtherEx.yaml...

set:
Replacing $caktux with 0x884b9f474007cfffeb80b8622de4ed22ece6df93 (3)
Replacing $zg with 0x239eb5afa5b1da814a3ccb60e79de1f933f1b470 (3)
Replacing $mids with 0x2ad9e5d8960882c07b96e2a21d5a39ab082e7368 (3)

deploy:
Deploying etherex.se...
Traceback (most recent call last):
File "/usr/local/bin/pyepm", line 11, in
sys.exit(main())
File "/Library/Python/2.7/site-packages/pyepm/pyepm.py", line 105, in main
deployment.deploy()
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 83, in deploy
contract_names=contract_names if contract_names else name)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 176, in create
tx_hashes = self.try_create_deploy(contract, from_, gas, gas_price, value, retry, skip, wait, verbose, contract_names)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 256, in try_create_deploy
tx_hash = self.try_create(contract, contract_name=contract_names, from_=from_, gas=gas, gas_price=gas_price, value=value)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 264, in try_create
tx_hash = instance.create(contract, from_=from_, gas=gas, gas_price=gas_price, endowment=value)
File "/Library/Python/2.7/site-packages/pyepm/api.py", line 207, in create
net_price = self.gasprice()
File "/Library/Python/2.7/site-packages/pyepm/api.py", line 144, in gasprice
result = self._rpc_post('eth_gasPrice', None)
File "/Library/Python/2.7/site-packages/pyepm/api.py", line 84, in _rpc_post
r = requests.post(self.jsonrpc_url, data=json.dumps(payload), headers=headers)
File "/Library/Python/2.7/site-packages/requests/api.py", line 107, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Library/Python/2.7/site-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/Library/Python/2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/Library/Python/2.7/site-packages/requests/adapters.py", line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=8545): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x10df1f310>: Failed to establish a new connection: [Errno 61] Connection refused',))
13inch:contracts tom$

pyepm.api.ApiException: code=-32000, message="unknown account"

Heya!
Sorry to bother you dudes, I sure hope you can help me get past this show stopper that's had me stuck for a couple of months and I've basically given up fixing it.... I'm trying to bring up your Etherex exchange instance on my Mac 10.10.5. Want to make a NZD-Ethereum exchange for down-under!

I need help solving the error: pyepm.api.ApiException: code=-32000, message="unknown account"

Any ideas where I can set or check the account settings?

==
I'm starting up my private-net like this:

nice geth --datadir ~/Library/Ethereum/devnet --ipcpath ~/Library/Ethereum/geth.ipc --mine --etherbase 0x82Ac50716A13B7f08F9cAb371418E08bEFa5D096 --nodiscover --maxpeers 0 --rpc --rpcapi "db,eth,net,web3" --rpccorsdomain http://localhost:8089 --port="30303" --pprofport="6060" --rpcport="8545" --nat "any" --minerthreads 1 --verbosity 3 --pprof --shh --unlock 0x82Ac50716A13B7f08F9cAb371418E08bEFa5D096

==
I then startup etherex, so far so good:

13inch:frontend tom$ grunt
Running "webpack-dev-server:start" (webpack-dev-server) task
webpack-dev-server on port 8089
Version: webpack 1.14.0
Asset Size Chunks Chunk Names
7ea52b1914022c4ebc15dafe3b116d03.woff2 30.5 kB [emitted]
f4769f9bdb7466be65088239c12046d1.eot 20.1 kB [emitted]
e18bbf611f2a2e43afc071aa2f4e1512.ttf 45.4 kB [emitted]
89889688147bd7575d6327160d64e760.svg 109 kB [emitted]
303a14e0add7b3b94327f9f349cf0b4a.jpg 11.1 kB [emitted]
072d782a9ddd24fd16f50d5b5a6b5481.eot 35 kB [emitted]
03d14078bd4d8d2525df26928e72f900.woff 38.2 kB [emitted]
4868942007735e9bf8096dbd51ab4c83.woff2 30.4 kB [emitted]
fb319a9750a64a4888f3d2805e7ad6b0.ttf 76.4 kB [emitted]
69c898bcb60d75bfd2518780428ee8eb.svg 206 kB [emitted]
1f18335a6cc3bde61c116370c7b0b788.eot 35.3 kB [emitted]
ff09f0600f30ccc2789d51d03d794a06.woff 38.4 kB [emitted]
fa2772327f55d8198301fdb8bcfc8158.woff 23.4 kB [emitted]
1721a5c97ce23ab97e3ad0c90bd4f4b5.ttf 76.4 kB [emitted]
8ff2f359d1286c170d1f1fc356e998e9.svg 207 kB [emitted]
7a697e6d4548decd889c8d6bb4164be4.eot 37.9 kB [emitted]
2abf6bb3a6f60451054c2a7ac338cd93.woff 41.1 kB [emitted]
3cc2079e69ac976ffe92418179449475.woff2 32.8 kB [emitted]
a933c16a2acbad281147577027220125.ttf 82.5 kB [emitted]
226f0cfee2031c8dd863a648379aacd9.svg 211 kB [emitted]
304888470673edcc9a9f95062e33ddd2.eot 8.18 kB [emitted]
3438f55fd9930f13e3bd34ee2dc299fb.ttf 8.02 kB [emitted]
36da4d49be8f55e660f9e81269824128.svg 7.96 kB [emitted]
app.js 6.29 MB 0 [emitted] main
webpack: bundle is now VALID.

=====
Then I try to deploy contracts:

13inch:contracts tom$ pyepm EtherEx.yaml
PyEPM 1.0.2

Deploying EtherEx.yaml...

set:
Replacing $caktux with 0x884b9f474007cfffeb80b8622de4ed22ece6df93 (3)
Replacing $zg with 0x239eb5afa5b1da814a3ccb60e79de1f933f1b470 (3)
Replacing $mids with 0x2ad9e5d8960882c07b96e2a21d5a39ab082e7368 (3)

deploy:
Deploying etherex.se...
Gas price: 0.0200 szabo * 1.0000
Our price: 20,000,000,000
Traceback (most recent call last):
File "/usr/local/bin/pyepm", line 11, in
sys.exit(main())
File "/Library/Python/2.7/site-packages/pyepm/pyepm.py", line 105, in main
deployment.deploy()
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 83, in deploy
contract_names=contract_names if contract_names else name)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 176, in create
tx_hashes = self.try_create_deploy(contract, from_, gas, gas_price, value, retry, skip, wait, verbose, contract_names)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 256, in try_create_deploy
tx_hash = self.try_create(contract, contract_name=contract_names, from_=from_, gas=gas, gas_price=gas_price, value=value)
File "/Library/Python/2.7/site-packages/pyepm/deploy.py", line 264, in try_create
tx_hash = instance.create(contract, from_=from_, gas=gas, gas_price=gas_price, endowment=value)
File "/Library/Python/2.7/site-packages/pyepm/api.py", line 222, in create
return self._rpc_post('eth_sendTransaction', params)
File "/Library/Python/2.7/site-packages/pyepm/api.py", line 93, in _rpc_post
raise ApiException(response['error']['code'], response['error']['message'])
pyepm.api.ApiException: code=-32000, message="unknown account"
13inch:contracts tom$

Do I need to deploy contracts everytime I start and stop my private-net? Thanks!

==
Some details:

Darwin 13inch.local 14.5.0 Darwin Kernel Version 14.5.0: Tue Apr 11 16:12:42 PDT 2017; root:xnu-2782.50.9.2.3~1/RELEASE_X86_64 x86_64
node -v v7.8.0
npm -v 4.2.0
eth -v
dyld: Symbol not found: __ZN8CryptoPP10RandomPool34GenerateIntoBufferedTransformationERNS_22BufferedTransformationERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEy
Referenced from: /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Expected in: /usr/local/opt/cryptopp/lib/libcryptopp.dylib
in /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Trace/BPT trap: 5
Python 2.7.10
eth --version
dyld: Symbol not found: __ZN8CryptoPP10RandomPool34GenerateIntoBufferedTransformationERNS_22BufferedTransformationERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEy
Referenced from: /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Expected in: /usr/local/opt/cryptopp/lib/libcryptopp.dylib
in /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Trace/BPT trap: 5
13inch:contracts tom$
eth --version
dyld: Symbol not found: __ZN8CryptoPP10RandomPool34GenerateIntoBufferedTransformationERNS_22BufferedTransformationERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEy
Referenced from: /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Expected in: /usr/local/opt/cryptopp/lib/libcryptopp.dylib
in /usr/local/Cellar/cpp-ethereum/1.3.0/lib/libdevcrypto.dylib
Trace/BPT trap: 5

build issue on OSX 10.10.1

After running the "grunt" command i got this error:

Running "webpack-dev-server:start" (webpack-dev-server) task
webpack-dev-server on port 8089
Version: webpack 1.4.15
Asset Size Chunks Chunk Names
7ad17c6085dee9a33787bac28fb23d46.eot 20335 [emitted]
e49d52e74b7689a0727def99da31f3eb.ttf 41280 [emitted]
ff423a4251cf2986555523dfe315c42b.svg 62926 [emitted]
68ed1dac06bf0409c18ae7bc62889170.woff 23320 [emitted]
692b2ac094cb0b2679dadd8cba568087.woff 24680 [emitted]
bundle.js 3258457 0 [emitted] main

ERROR in ./app/components/Tools.jsx
Module not found: Error: Cannot resolve 'file' or 'directory' ./SubWithdraw in /Users/aurel/etherex/frontend/app/components
@ ./app/components/Tools.jsx 15:18-42
webpack: bundle is now VALID.

ETX contract address vulnerability

There is a security issue in https://github.com/etherex/etherex/blob/master/contracts/etx.se
as you are accessing self.storage[recipient] directly, it can be used to overwrite contract ownership, market and exchange_id. Instead I would suggest to use a defined storage data structure for the account balances.

Minimal Viable Test :)

from pyethereum import tester

class TestEtxContract(object):

    CONTRACT = 'contracts/etx.se'

    def setup_class(cls):
        cls.s = tester.state()
        cls.c = cls.s.abi_contract(cls.CONTRACT)
        cls.snapshot = cls.s.snapshot()

    def setup_method(self, method):
        self.s.revert(self.snapshot)

    def test_send_with_invalid_recipient_should_not_overwrite_internal_settings(self):
        assert self.c.set_exchange(0xdeadbeef, 999)
        assert self.c.send(0, 1) == 0
        assert self.s.block.get_storage_data(self.c.address, 0) == int(tester.a0, 16)

        assert self.c.send(1, 1) == 0
        assert self.s.block.get_storage_data(self.c.address, 1) == 0xdeadbeef

        assert self.c.send(2, 1) == 0
        assert self.s.block.get_storage_data(self.c.address, 2) == 999

Etherex github code error

Hello,
When i run this command ----
pip install -r dev_requirements.txt
it gives me error :
RuntimeError: Format missing, but need one (identified source as text as no file with that name was found).
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-bXEQS5/eth-hash/
what can i do for solve this issue..
Please help..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.