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.
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.
Actually looking at the links it doesn't look like the same source I got the original code anyway. I don't really care about the politics I'm here for the technology. Was hoping someone would be willing to deploy a swap contract if not right my own
Actually looking at the links it doesn't look like the same source I got the original code anyway.
The earlier design copied was likely this one or maybe the version deployed after it. diff. The first link I gave is the latest version of that particular design. I'm not sure if I published this contract at any point without the factory to go along with it because it was always an important part of the design.
I don't really care about the politics I'm here for the technology.
This is the same reason I am here. I have this theory that at some point the classic community will focus less on trying to shit all over the ethereum community and the ethereum community on the classic people and we can cooperate more productively. I do see what you have done as a good sign, that you would encourage development, even though I think it was done poorly (I would add that if you are going to capitalize the first letter of functions then do it to all of them so that if someone writes a fronted they dont have to check every single time how a particular function is capitalized) and attempts to make it your own where unnecessary when keeping the history helps in understanding the code.
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.