With the Ethereum looking to hit its maximum contract size limit, a new standard has been designed to help combat the potential problem. The size limit of contract of Ethereum is currently 24KB, at which it contains a lot of functions and code. It can create a real issue for a number of contracts. For example, an ERC1400 Security Token Standard needs 27 functions in addition to 13 events. Another contract standard called ERC-998 Composable Non-Fungible Token Standard needs 31 functions. These, in addition to the application-based code contracts, need to implement them, can cross the 24KB maximum value easily. Even if the developers do not want to implement large standards, they will still want large contracts, so that related codes are kept together underneath the Ethereum address. Keeping all the state and functions together also makes it much easier to amend contract storage as required. Initially, there were talks about increasing or removing the contract size altogether. But, the developers opposed it, citing that it would create unnecessary technical problems.
On July 10th, programmer Nick Mudge announced that the ‘proxy contracts’ developed by Vitalik Buterin might be the answer to the developing problem, the new standard proxy called Diamond Standard would make it even better. Proxy contracts are those contracts that are stored in a concise manner by taking functions from other contracts. Mudge further added that the standard contracts like ERC1400 Security Token Standards need functions and events that make them hit the limit quickly. The new standard created by Mudge called the Diamond Standard would allow programmers to make small contract by borrowing functions from multiple contracts. The contract that has Diamond Standard will be called Diamond to differential it from other regular and proxy contracts. The Diamond Contracts will have several sides and functions along with a transparent and flexible method to be able to create diamonds that can easily be upgraded. Just like a real diamond, the Diamond on Ethereum will have facets. Every contract that such a diamond will borrow will have a different facet on it.
In addition, the Diamond Standard will also offer 4 functions known ad Loupe that stores all the information about the different facets and the functions that exist in it. The name comes from the word ’Loupe’ which is a magnifying glass which is greatly used in the jewelry industry to inspect the diamonds. Ronan Sanford, the author of ERC-1155 Standard, is also looking to add diamonds to builder-deploy that would make it easy for them to cut the diamonds to allow deploying contracts to any of the other networks.
According to Mudge, the community has been highly supportive of the new standard developed by him. Many individuals and companies have already started testing the Diamond Standard’s and are hopeful of its potential. Recently, ConsenSys Diligence had carried out a public security audit of the different Codefi contracts and, in the end, suggested them to use Diamond Standard in order to overcome the contract size issue faced by them. Another company VolleyFIre, a liquidity provider for decentralized exchange, is also using Diamond Contracts.