This article is a development report of a Dex223 decentralized exchange.
We’re building an exchange to speed up adoption of the ERC-223 token standard. ERC-223 was created to solve a security problem in the older ERC-20 standard. Security issue of ERC-20 caused $200M losses on Ethereum in 2023.
Take a look at other Dex223 development reports.
The most important change during this month was the decision to upgrade the D223 token. After more than a year of convincing the Etherscan and other participants of the Ethereum ecosystem to support the ERC-223 event signatures without any success we decided to change the contract in a way that would emit a ERC-20 compatible event on token transfers. This would make Etherscan label this as a "ERC-20 token transfer" (which is incorrect as the token being transferred is ERC-223 in fact) and let D223 token holders observe token trasnactions easier.
It must be said that Etherscan does support ERC-223 token transfers on Sepolia testnet but refuses to do the same for the mainnet for some unknown reason.
There was another small but important change - we have updated the standard()
function of D223 token to return uint32 value instead of string
as defined in the ERC-223 standard.
ERC-223 standard was finalized in 2023, however the production implementation of ERC-223 token exposed a number of problems with the standard() function that would return string values, for instance it is not gas-efficient to call this function from another contract as it would require additional workflow to use its returned value for example for safety checks. As the result we decided to switch to uint32 return instead.
As the result the new D223-v2 token was created, the source code can be found here: https://github.com/Dexaran/D223-token-v2/
We've built a simple UI that would allow users to convert old D223 tokens to new D223-v2 tokens: https://dex223.io/upgrade
-
Old D223 token smart-contract for reference: https://etherscan.io/address/0xcCe968120e6Ded56F32fbfe5A2Ec06CBF1e7c8ED#code
-
New D223-v2 token contract: https://etherscan.io/address/0x0908078Da2935A14BC7a17770292818C85b580dd#code
The new D223 token will be listed on BitMart and other exchanges. Please, upgrade your D223 tokens if you bought them during the ICO on Ethereum chain before October 2024.
-
ERC-7417 Token Converter was audited (audit report). 1 high severity issue was found. Fixed at https://github.com/ethereum/ERCs/commit/62bdf2deb479199a2b219b268417fe0e9fabaa46
-
D223-v2 token contract and Upgrader contract were audited (audit report). 1 high severity issue was found. Fixed at https://gist.github.com/Dexaran/8eb891decb7cbc125d67c552f1d537a9?permalink_comment_id=5234412#gistcomment-5234412
Our auditor started reviewing the source codes of Dex223 contracts. After he will complete the review we will pass a security audit with an auditing company and then the contrcats will be deployed.
We have deployed Dex223 smart-contracts on EOS EVM. We faced a number of problems that prevented us from integrating this with our UI however, most notably there is an unpatched issue with EOS EVM logs: VaultaFoundation/evm-node#303
We are working on our own TheGraph instance for EOS EVM: https://testnet.thegraph.com/explorer/subgraphs/EpxEBnFqM8QQqZPSYWAmwpx8QtjPpFJFoqdps6oRsccR?view=Indexers&chain=arbitrum-sepolia
It was originally planned to release the EOS EVM UI in November for public testing but this was delayed due to the high number of UI issues that needed to be fixed before release and the EOS EVM UI build remained in unsable state. It will most lilely go live in December.
The structure of Dex223 margin trading is composed of many entities responsbile for different parts of the process. Funding providers supply the funds, traders borrow the funds and execute trades and in case the trade doesn't go well - there are parties responsible for executing liquidations.
We assume that liquidations will be executed by bots in exchange for profit (allocated by the lender). We are developing the reference sctip that will monitor positions and detect those that need to be liquidated - and then executes the liquidation transaction.
This script is still work-in-progress but the initial source code is available here: https://github.com/Exzender/dex223-liquidations
Dex223 team will most likely run "position liquidator" service during the initial stage after the launch of the exchange and it's margin trading module.
We had a number of problems associated with the native assets support (ETH on Ethereum chain) related to the ability of a user to convert ERC-20 Wrapped Ethereum to ERC-223 Wrapped Wrapped Ethereum via the ERC-7417 Converter.
Those issues were fixed. In case you still experience any problems with native assets - feel free to comment on this github gist thread or contact us in our telegram discussion group. You can also submit a bug report via our "Feedbacks" form in the exchange UI.
-
Transaction gas settings were supported for all types of trasnactions. Earlier we only had properly customizable gas settings for Swaps and the rest of the trasnactions (adding liquidity, claiming positions etc.) used auto-set values. Now all the transactions are customizable.
-
Error handling was improved to properly display failed transactions and provide the user with possible reasons.
-
Mobile MetaMask now uses it's internal browser. Most DEXes do not allow MetaMask to be connected via mobile version requiring WalletConnect to be used instead. We've experienced a number of problems with this approach, as the result we're also supporting the method recommended by MetaMask team: it's internal browser.
-
Transaction speed ups are now integrated. A user will be provided with an option to "speed up" any transaction. This is helpful in case of a sudden network costs increase, for example if the user was submitting a transaction at the moment when the network costs were about 10 GWEI but at the next block the gas prices increased significantly then users transaction sill get stuck until the network gas prices will drop back to 10 GWEI. In order to address this problem we are introducing an option to replace the existing 10-GWEI transaction with an identical one that has higher gas price.
Figma templates and a huge list of bug reports will be published in the next development report.