The Smart Contracts that Govern the MELD Protocol

The Smart Contracts that Govern the MELD Protocol

Bill Roy

Bill Roy

MELD Ambassador

November 25, 2021

A smart contract is a digital agreement created, stored, and executed on a blockchain.

The Smart Contracts that Govern the MELD Protocol 

What is a “Smart Contract”?

It is a predefined code with many benefits, ultimately unlocking the ability for DEXs, DeFI protocols, and various dApps utilized on a blockchain. While there is nothing intelligent about them, these lines of code are referenced as ‘smart’ because of their power in self-execution. When the parameters of the agreement are met, the contract completes, fulfilling the agreed predetermined outcome. For example, you lend your friend $20, and they agree that they will pay you back $25 by the next week or you get their ticket to a concert. In a smart contract, if your friend fails to pay you by the deadline, the concert ticket is sent to you automatically, without effort on your part. There are many use cases for smart contracts in the "real world,"  and the utility will only increase as the technology evolves and cryptocurrency adoption grows.

As with anything in life, often there are risks associated and smart contracts are no exception. Since they are just programs with predetermined variables, there can be exploitable loopholes. Ethereum Classic was born from such a breach in 2016 when the "the DAO attack" occurred, and there was a hard fork that bailed out the contract by forcing a funds restoration. Since a smart contract is only a preconfigured set of variables and not an intelligent entity, it cannot make any kind of interpretation or pass judgment to mitigate the actions of a malicious actor. There are many different kinds of risks involved with smart contracts and we’ll outline some of the validation processes and tools MELD is developing later in this article. 

While there are risks with developing and implementing smart contracts, there are significant advantages that have shown to outweigh the risks - as the famous saying goes, “no risk, no reward.”  Smart contracts are self-executing, which means they are trustless, impartial, and automatic since they don’t rely on a third party to enact or complete the contract. A third party could have ulterior motives, bias, additional fees, or process delays. There is no file cabinet in an office or a file directory in a single database - smart contracts are distributed on a decentralized blockchain network, so they are secure and transparent.  They are efficient because they are clear, accurate, fast, and cheaper. The advantages of smart contracts have led to their adoption and implementation in various industries with increasing scope and utilization.

Managing MELD Protocol Functions

In their whitepaper, MELD has outlined the basics of the various smart contracts that the MELD protocol will utilize. The following is a list of the core smart contracts that will establish and run the MELD protocol with which its users will conduct decentralized finance operations:

  • Lending Contract
  • Borrowing Contract
  • Vault Contract
  • Staking Contract
  • Governance Contract
  • Fiat Contract

These sets of self-executing agreements will be able to seamlessly be deployed from a straightforward and intuitive user interface that will empower its users to lend and borrow funds in a fast, safe, and transparent manner. These smart contracts will be maintained and governed by the MELD Foundation. This group will regularly provide transparent data for auditing the fiat accounts and supply documentation for regulation compliance.

The lending smart contract will track the investment of funds. An investor will use the MELDapp to deposit their assets, initiating this contract. It will supply the lender with their APR/APY payments and their investment return upon completion of the contract.

Once a collateralized debt position is confirmed, the borrowing smart contract contacts the liquidity provider to transfer the borrowed funds. Additionally, it will supply jurisdiction-based documentation necessary for fiat loans and provide the borrower with MELD tokens for participating in the protocol.

When a user provides crypto liquidity to yield farm, the vault smart contract governs the crypto liquidity swapping and associated fees. It is used in liquidity tracking and withdrawal validation.

Keeping in line with Cardano’s no-lock approach, the staking smart contract allows the user to unstake their MELD at any time. This smart contract supplies the user with protocol rewards when they stake their MELD tokens to the insurance pool.

Periodically the protocol’s parameters will need to be updated, and participants will likely want to incorporate new crypto as collateral. The governance smart contract gives the users a means to voice their opinion. A user can pay a small fee to submit a proposal voted on by those staking their MELD.

Keeping updated valuation of assets is crucial to the protocol and is maintained by the fiat smart contract. An oracle will track the real-time price updates and correct the collateral ratio of collateralized debt positions. 

Conclusion

Smart contract utility and use cases in the "real world" will continue to grow and develop as cryptocurrencies adoption increases. MELD believes in the power of protocol, not platform, so it is of the utmost importance that the smart contracts that manage and govern the protocol be complete and secure. Since Cardano has few smart contract testing and validation options, MELD has partnered with Dr. Nguyen Anh Quynh to develop Hachi. Hachi will serve as an analysis and troubleshooting structure that initially focuses on the on-chain aspects of smart contracts on Cardano. The tools in development are a debugger, a tracer, a vulnerability hunter, and a reverser, among others. As this analytical foundation further develops, the scope of the tools will extend to KEVM & IELE integrations. Hachi will be made available for use by the community as an open-source toolset.

Having been possible only since September 12th, smart contract capabilities on Cardano are still young and emerging. By helping to provide comprehensive auditing tools to the community with Hachi, MELD not only strengthens its community connection but also further secures and validates the smart contracts that are essential and fundamental to the MELD DeFi protocol.

Disclaimer

The opinions shared within this article are those solely of the MELD Ambassador. Note that the content within should not be considered financial, legal, or tax advice. Neither the author nor MELD Labs PTE Ltd. are financial, legal or tax advisors. None of this content should be used to make any form of financial, tax, or legal decisions. Do your own research and consult professionals as needed for official policies, restrictions, and requirements in your jurisdiction.

If you believe in the MELD vision, want to support this initiative, and want to help promote the future of finance then we want you to join the MELD Ambassador Program!

Tags
MELD
smart-contracts

MELD with us.