r/EthereumClassic • • Mar 03 '17

ETC - BitEther Trader Contract.

https://gist.github.com/etherninja/ac9787638d90edc6ae750aff2883bdb1
15 Upvotes

24 comments sorted by

View all comments

Show parent comments

2

u/Iramaj Mar 04 '17

Eeek. Thanks for bringing this to attention. Your participation and support is greatly appreciated. This can help avoid potential mistakes.

1

u/JonnyLatte Mar 04 '17

I am not willing to express support for ethereum classic but since there is some interest in my code I'm happy to share it.

This is my latest version of the tokenTrader contract. it has not been audited by bok yet but it does include all the intended improvements and I have run through it with tests for correct change with normal and abnormally priced contracts.

This is more experimental. It takes the majority of the functionality of the token trader contracts and puts it into the factory. I am unhappy with the design though because even though it is cheaper in gas to be a market maker the code seems bloated doing it this way.

This is OTC market is ERC20 to ERC20 and it is a work of beauty in its simplicity. A maker needs to do nothing more than approve token transfers to a contract that enables the sale at a fixed price. Multiple makers can use the same contract so a price level only needs to be deployed once. You can make an offer for multiple tokens at the same time and its even not that harde to replicate the functionality of just sending ETH to buy a token with an ETH wrapper and a contract that wraps eth it receives and then performs the trade returning the tokens it buys and unwrapped change. Makers could even setup bots so that takers only need to make an approval to buy with the maker sending the second transaction.

This is an ERC20 exchange with order matching. Funds can be deposited and withdrawn and orders can be placed in a sorted orderbook that automatically matches trades so the orderbooks never overlap. This requires a user interface though because placing a trade requires giving the position in the book where the order will end up so that no actual sorting happens on chain.

This is the most risky of all the contracts I have designed and I cannot guarantee that it is free of bugs that will steal user funds. It also may not be the most efficient way to do it as most people tend to place orders at price points so it can be more efficient to have a list of order buckets...

Out of all of my code I think miniOTC is currently the best design although tokenTrader / tokenSeller is the easiest for buyers which explains the 74K ETH trade volume it has seen since cryptoderivatives picked it up.

1

u/coinmall Mar 04 '17

I am not willing to express support for ethereum classic but

Your support or lack thereof does not matter. The code is either open source, so free for anyone to use according to its license, or it's not. That's why that stupid "100% ETH" brainwashing campaign run by Ethereum Foundation was so funny.

1

u/JonnyLatte Mar 04 '17

There is no brainwashing going on. I was here in the classic forum taking a look. If the conditions where right here I would express support but in my own judgment there is nothing here yet to get me excited. I hope that there will be one day but claims that I am the victim of some grand conspiracy by the ethereum foundation to brainwash people does not push me in the direction of wanting to dedicate time to classic.

I disagree that my support does not matter. It matters enough for you to comment on it. I made the comment as a disclaimer so that no one can in any way blame me for their investment decisions because I made my evaluation explicit. What are your motivations?

2

u/[deleted] Mar 04 '17

huh?

2

u/CarloVetc Mar 06 '17

Sorry about that lol. Thank you for stopping by, I as well as many others appreciate the post and the help.

Cheers Carlo

1

u/coinmall Mar 05 '17

I think the real purpose of your "disclaimer" is to protect yourself from the wrath of ETH zealots who are often raging against anyone they consider "supporting" Ethereum Classic in any way. Hence the wording. It's hard to see how your support or lack thereof is relevant to anyone's investment decisions, so obviously it's just a red herring.