Contract Event
The DODO platform contracts will trigger events in some key operations, among which the common events include the event of creating different pools, the event of token swap in pools, etc.
The types of funding pools currently supported by the DODO platform include DODO V1 classic pool, DODO V2 public pool, DODO V2 private pool and DODO V2 anchored pool. All four types of pools are created by the corresponding factory contract execution and trigger creation events, as follows:
DODO V1 Classic pool: the corresponding factory contract name is DODO Zoo and the events that the third party platform needs to listen to are
event DODOBirth(address newBorn, address baseToken, address quoteToken);
where newBorn is the DODO V1 Classic Pool contract address.
DODO V2 public pool: the corresponding factory contract name is DODO Vending Machine Factory and the events that the third party platform needs to listen to are
event NewDVM(
address baseToken,
address quoteToken,
address creator,
address dvm
);
where dvm is the DODO V2 public pool contract address and creator is the pool creation account
DODO V2 Private Pool: The corresponding factory contract name is DODO Private Pool Factory and the events that the third party platform needs to listen to are
event NewDPP(
address baseToken,
address quoteToken,
address creator,
address dpp
);
where dpp is the DODO V2 private pool contract address and creator is the pool creation account.
DODO V2 Anchor Pool: The corresponding factory contract name is DODO Stable Pool Factory and the events that the third party platform needs to listen to are
event NewDSP(
address baseToken,
address quoteToken,
address creator,
address DSP
);
where dsp is the DODO V2 anchored pool contract address, creator is the pool creation account
Note: The above mentioned DODO Zoo, DODO Vending Machine Factory, DODO Private Pool Factory, DODO Stable Pool Factory can be obtained by querying the corresponding network under the contract address, and the contracts have all been open source and can be obtained directly in the blockchain browser ABI
The different types of pools can be aggregated by DODO's own routing and external aggregators, and can also be called directly for transactions. Each transaction triggers an Event, which can be used by third-party platforms to count the volume of the pools, and can be defined according to DODO V1 classic pools, and DODO V2 (including public, private and anchored pools).
DODO V1 Classic Pool: The third party platform needs to obtain the corresponding pool address and listens for the following events.
event SellBaseToken(
address indexed seller,
uint256 payBase,
uint256 receiveQuote
);
event BuyBaseToken(
address indexed buyer,
uint256 receiveBase,
uint256 payQuote
);
There are two types of EVENTS according to the direction of the token traded.
SellBaseToken represents the sale of a BaseToken to the pool and the purchase of a QuoteToken.
payBase represents the number of BaseTokens paid and receiveQuote is the number of QuoteTokens exchanged. BuyBaseToken represents the sale of a QuoteToken to the pool and the purchase of a BaseToken.
payQuote represents the number of QuoteTokens paid and receiveBase is the number of BaseTokens exchanged.
DODO V2 (public pools, private pools, anchor pools): the third party platform needs to obtain the address of the corresponding pool and listens for the following events.
event DODOSwap(
address fromToken,
address toToken,
uint256 fromAmount,
uint256 toAmount,
address trader,
address receiver
);
The pool transaction Event for DODO V2 is unified as DODOSwap, fromToken is the address of the token sold in, toToken is the address of the token bought in, fromAmount represents the number of tokens sold in, toAmount is the number of tokens bought in, trader is the transaction executor, and receiver is the target token receiving account.
Last modified 11mo ago