Posted By : Vishal
Decentralized systems and Dapps are getting lots of attention these days. Today everyone wants to get their hands on the decentralized application and get the mosts of the blockchain. Smart contracts are the core parts of the Dapps. As the use of Dapp is increasing day by day so the size of these contracts is also increasing day by day and these can't be held in a single contract. Even a simple Dapp consists of several smart contracts and ethereum has a limit of 24 Kb and also the sanity slips away as the contract becomes more complex. Here the orchestration patterns come into play to divide the functionality into parts. Before digging more into the concepts we first have to understand what is an orchestration after that we can understand how we can implement smart contracts.
In general, Orchestration is the joining of different data, service, code, or software to achieve a final product. Suppose you have data/code that is spread over 10 different servers and you want to use that under the same hood so you can achieve this by using the orchestration.
This concept is also used by various technology hubs one of its examples is Netflix Conductor.
In order to achieve this functionality break down your code into various manageable contracts and here you will find a contract that will call the function of other contracts.
Nowadays you can see most the popular platform uses the factory contract to initialize other contract or in simple words deploy all the other required contract. One of the most popular that uses this functionality is Uniswap. The Uniswap team solved the contract size problem with a simple check, but if you look more into the same you can find more examples of orchestration examples that are being coded from scratch for each project.
Another big example of such an Orchestration pattern is the DAO contract. Here several contracts are being deployed that are ERC20 token for tokens/votes, timelock for execution, governance for voting. Together with all these contracts, complete decentralized voting functionality can be achieved. Here ERC20 contract will manage the voted who can vote, how much voted will calculate for any user, Governance handles the proposal part (any particular proposal on which user vote) here user can vote, timelock contract will handle the execution of the required methods in the case of success.
In a similar, you can also add your own custom layer of the contract to add more security or customize this as per your functionality.
By using this blog you will get an overview of the Orchestration pattern and how this can be achieved using the solidity.
Reference Links: https://hackernoon.com/identifying-smart-contract-orchestration-patterns-in-solidity-pd223x20
December 17, 2024 at 08:19 pm
Your comment is awaiting moderation.