Smart Contract Architecture
The principles of simplicity, decentralization, and scalability underlie this system design that is resistant to protocol updates and token standards modifications.
Each token standard has its own contract set that implements the common logic.
The solution consists of a single factory and many pairs. The factory is responsible for creating and indexing. Each pair is represented as a token of the standard it addresses for exchange. If the pair is used for MILKY1.2-BNB exchanges, then it implements the MILKY1.2 interface and if it is designed for MILKY2-BNB token exchanges, then the pair is the MILKY2 token itself. As MILKY standards require a token to have metadata, a separate contract is used to manage the information and allow upgrade opportunities.
The token to token exchanges is managed by the singleton that implements the FA2 token standard for pool shares. Each exchange pair is represented by the separate LP asset of this multi-asset.
Each MILKY1.2-BNB exchange can delegate its MILKY to the baker that is chosen through the voting process. The users propose candidates, where it is required to check whether the Baker Registry is needed to avoid redelegation.
Copy link