Totle API

The Totle API Developer Hub

Architecture

This article provides an architectural overview of the Smart Contracts employed by Totle.

Smart Contract
Description
Notes

Responsible for the interaction between Totle and EtherDelta when filling orders

Responsible for all implementation specific logic required by each DEX

Due to the differing requirements of executing trades at each DEX, we employ the use of separate ExchangeHandler contracts. An ExchangeHandler is responsible for all implementation specific logic required by each DEX. This could range from depositing funds prior to initiating a trade to wrapping or unwrapping ether as required. It is a key requirement that we keep DEX logic separate from the primary contract in order to allow for expansion of the platform

Responsible for transferring ownership of ERC20 tokens from the investor to the TotlePrimary contract on execution of a sell order

TokenTransferProxy is responsible for transferring ownership of ERC20 tokens from the buyer/seller to the TotlePrimary contract on execution of a sell order. The buyer/seller is therefore required to set an allowance for the TokenTransferProxy prior to selling any tokens via Totle. The TokenTransferProxy maintains a record of addresses which have been authorized to transfer tokens on its behalf, the only address with this authorization is the TotlePrimary contract. In case of an upgrade to the primary contract, Totle is the only authorized party to approve this change. As the platform matures we may implement a safeguarding mechanism such as a multi-sig or time-locked contract to control address authorization and welcome feedback on this from the community

Loops through each token trade, sequentially executing all orders at their respective exchange handlers. This contract is entry point for external transactions and performs sanity checks on the payload

This contract is the sole entry point for external transactions and is responsible for performing sanity checks on the payload, executing trades via the respective exchange handler, and keeping count of amounts given and received in order to enforce minimum exchange rate requirements

Contract Addresses

TotlePrimary

0x3179e4cd7ff08eb14397e1c402d0de44e1523f2e

TokenTransferProxy

0x74758AcFcE059f503a7E6B0fC2c8737600f9F2c4

PartnerRegistry

0xFB2E4c813451a441F26530642fc83bF14D3141cF

EtherDeltaHandler

0xDf145332D6ac527C35879245b5A4fFd0Ea6c897b

KyberHandler

0x77b26c9f9b87668b66db65dce7cc2b392ff59966

BancorHandler

0x92aB1F32771e67172A00f1E1a78286355B0CDc80

ZeroXHandler

0x2840411594cFFEf97df411bf5f0dbF042feF6D21

AirSwapHandler

0x91F3935ed7a4ee8d15023c5Df26895B26aE98015

EthexHandler

0xe6b4C185e286905Cf34b53527F0338bfFb9759D0

Eth2DaiHandler

0x3BD3DdAdFF7a66612dF199154E682bC6B20733fF

TokenStoreHandler

0x3fF1445BE5674F0594f1614dB8606428342732D4

UniswapHandler

0xc095976BD18181f28626c5D48372DebD7a8Ce8d4

Architecture


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.