OTC TTTT - Trustless Token Transfer Trade
- You have a token that you want to sell but is not on exchanges and you seek OTC trade
- You have giant bags of token that has $1k daily volume and you want OTC trade
- You have a friend1 and you offer him a 5% discount and you need OTC trade
1 you meet a year ago at a conference and he is a cool guy but wouldn't trust with 1 BTC
Design goals
- Simplicity
- Transparency
- Check the code - it's that simple!
Running tests
truffle test
Known attacks
Front-running:
- https://hackernoon.com/front-running-bancor-in-150-lines-of-python-with-ethereum-api-d5e2bfd0d798
- https://coindecode.io/how-swim-made-thousands-gaming-the-eos-crowdsale/
- Flash Boys 2.0: https://arxiv.org/abs/1904.05234
- If I was that smart I wouldn't be coding such a simple contract
Workaround: pass the rate to the kamikaze
function. YEAH, I've called the function kamikaze
because I want to make you think and read the code.
License
https://en.wikipedia.org/wiki/WTFPL
WTFPL + immutable laws of the universe (including but not limited to karma) are still in play.
Just don't be a dick or an asshole.
Disclaimer
It's crypto, DYOR (do your own research), always ensure you know what you are doing. Try on the testnet first. When on mainnet - try with a small amount. If you don't know how to deploy the code, you probably should not use it.
Hire me
Do you like my code? Do you like my style? You may want to hire me for side projects.
https://genesis.re/wiki#Plan_B
Developed with
$ truffle version
Truffle v5.0.14 (core: 5.0.14)
Solidity v0.5.0 (solc-js)
Node v10.15.3
Web3.js v1.0.0-beta.37