Introduction
Introduction
The Smart contracts serve as the bridge between our user interface and the risk engine to create the on-chain risk system. The contracts will capture data from both the front end, back end, and the risk engine to create essential elements of the protocol such as Protection, Loans, Liquidity pools, and Portfolios.
System Architecture
The smart contract suite we've developed adopts a modular design, prioritizing both security and adaptability. Our framework ensures that we can seamlessly integrate, modify, or remove contracts without compromising the system once deployed. Below is an overview of the system's core components.
Core Contract Overview
Protocol
The protocol serves as the primary gateway to the entire system. It operates as a streamlined template, able to execute authorized modules within the system. The protocol gives us the ability to add and remove paths to system-specific functionality.
Managers
The managers act as the central registry for modules, blueprints, and actions. Managers are designed to give the protocol the flexibility to seamlessly enable or disable components. Each manager is structured in a hierarchical manner, one level above the previous ensuring streamlined coordination, communication, and interaction among the system.
Module Manager
Blueprint Manager
Action Manager
Access Control Manager
Modules
The Module level functions as an elevated execution layer within the protocol, providing a path to pivotal blueprints that meet protocol-specific demands. This layer gives us the ability to add and remove blueprints to the system.
Blueprints
The Blueprint level functions as the decision-making layer within the protocol. The blueprints give us the ability to guide the execution of individual logic components (Actions) to create intricate sequences of operations that embody the functionality and behavior of the entire system.
Actions
The actions are the foundational level of the protocol. Actions are singular logic components that serve as the building blocks for constructing comprehensive protocol flows.
Helpers
At the global level Helper contracts are created and are purposefully crafted to cater to the whole protocol by supporting various protocol functionalities.
Concrete Storage
At the storage level Concrete storage is created, and we will be following the Eternal Storage Pattern. This pattern distinctively separates storage and logic for smoother contract data transitions, simplifying complexity and enhancing security. Lastly, these contracts are where all information on the protocol will live. Please refer to this link to see an implementation.
Global security
Global security lives within our helpers. These contracts contain essential utilities such as modifiers and input validation functions, ensuring consistent security checks and standards throughout the system.
Integration within the Product Ecosystem
The smart contracts will serve as a data hub and a data capture offering information to the subgraph, front end, and back end of the protocol.
Last updated