From ec3463a7eaf24dd39b817c897975bf3979229538 Mon Sep 17 00:00:00 2001 From: Nikolai Kryshnev Date: Sat, 8 Feb 2025 01:16:10 +0300 Subject: [PATCH 1/5] =?UTF-8?q?typo:=20critera=20=E2=86=92=20criteria=20in?= =?UTF-8?q?=20shouldReset=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- developers/mento-core/smart-contracts/breakerbox/ibreaker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/mento-core/smart-contracts/breakerbox/ibreaker.md b/developers/mento-core/smart-contracts/breakerbox/ibreaker.md index 40e395a..501b3ec 100644 --- a/developers/mento-core/smart-contracts/breakerbox/ibreaker.md +++ b/developers/mento-core/smart-contracts/breakerbox/ibreaker.md @@ -66,7 +66,7 @@ function shouldReset(address rateFeedID) external returns (bool resetBreaker) Check if the criteria to automatically reset the breaker have been met. -_Allows the definition of additional critera to check before reset. If no additional criteria is needed set to !shouldTrigger();_ +_Allows the definition of additional criteria to check before reset. If no additional criteria is needed set to !shouldTrigger();_ ### Parameters From 7b64fac0534b0f40c652e3fc3d43d1125d3d8b5b Mon Sep 17 00:00:00 2001 From: Nikolai Kryshnev Date: Sat, 8 Feb 2025 01:17:24 +0300 Subject: [PATCH 2/5] =?UTF-8?q?typo:=20specifed=20=E2=86=92=20specified=20?= =?UTF-8?q?in=20shouldReset=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mento-core/smart-contracts/breakerbox/mediandeltabreaker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/mento-core/smart-contracts/breakerbox/mediandeltabreaker.md b/developers/mento-core/smart-contracts/breakerbox/mediandeltabreaker.md index dbce009..a07c6b3 100644 --- a/developers/mento-core/smart-contracts/breakerbox/mediandeltabreaker.md +++ b/developers/mento-core/smart-contracts/breakerbox/mediandeltabreaker.md @@ -122,7 +122,7 @@ Check if the current median report rate for a rate feed change, relative to the function shouldReset(address rateFeedID) external returns (bool resetBreaker) ``` -Checks whether or not the conditions have been met for the specifed rate feed to be reset. +Checks whether or not the conditions have been met for the specified rate feed to be reset. ### Return Values From 02c114669a470fb3443e15f9f953d6146529477e Mon Sep 17 00:00:00 2001 From: Nikolai Kryshnev Date: Sat, 8 Feb 2025 01:18:32 +0300 Subject: [PATCH 3/5] =?UTF-8?q?typos:=20keps=20=E2=86=92=20keeps=20in=20re?= =?UTF-8?q?set=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- developers/mento-core/smart-contracts/broker/tradinglimits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developers/mento-core/smart-contracts/broker/tradinglimits.md b/developers/mento-core/smart-contracts/broker/tradinglimits.md index 558c313..f94fbe8 100644 --- a/developers/mento-core/smart-contracts/broker/tradinglimits.md +++ b/developers/mento-core/smart-contracts/broker/tradinglimits.md @@ -99,7 +99,7 @@ _Reverts if the limits are exceeded._ function reset(struct TradingLimits.State self, struct TradingLimits.Config config) internal pure returns (struct TradingLimits.State) ``` -Reset an existing state with a new config. It keps netflows of enabled limits and resets when disabled. It resets all timestamp checkpoints to reset time-window limits on next swap. +Reset an existing state with a new config. It keeps netflows of enabled limits and resets when disabled. It resets all timestamp checkpoints to reset time-window limits on next swap. ### Parameters From f39f88bde4614e4c1521aeccf12e18b3c14a4d71 Mon Sep 17 00:00:00 2001 From: Nikolai Kryshnev Date: Sat, 8 Feb 2025 01:23:12 +0300 Subject: [PATCH 4/5] fix formatting issues and minor typos in Smart Contracts documentation --- .../mento-core/smart-contracts/README.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/developers/mento-core/smart-contracts/README.md b/developers/mento-core/smart-contracts/README.md index 3389645..00e7ec2 100644 --- a/developers/mento-core/smart-contracts/README.md +++ b/developers/mento-core/smart-contracts/README.md @@ -12,22 +12,22 @@ The Mento protocol consists of a set of smart contracts, which are deployed on t ### Smart Contracts -****[**Broker**](broker/) is the entry point for interacting with the protocol. It is responsible for managing reserve assets and is the only contract with spender rights of the reserve as well as minting and burning rights over stable assets. For pricing trades, it relies on exchange providers like BiPoolManager.sol. When executing swaps, it enforces trading limits. The Broker also exposes a burn function for burning stable tokens without being subject to trading limits or regular exchange operations. +[**Broker**](broker/) is the entry point for interacting with the protocol. It is responsible for managing reserve assets and is the only contract with spender rights of the reserve as well as minting and burning rights over stable assets. For pricing trades, it relies on exchange providers like BiPoolManager.sol. When executing swaps, it enforces trading limits. The Broker also exposes a burn function for burning stable tokens without being subject to trading limits or regular exchange operations. -****[**BiPoolManager**](iexchangeprovider/bipoolmanager/) **** is the first implementation of an IExchangeProvider which manages virtual asset pools that consist of two assets. With its state information on assets and bucket sizes, it prices trades using a pricing module. It also checks if trading is allowed or suspended as decided by the on-chain circuit breaker BreakerBox.sol. It can price trades with constant-product or constant-sum as specified in the respective pricing modules. +[**BiPoolManager**](iexchangeprovider/bipoolmanager/) is the first implementation of an IExchangeProvider which manages virtual asset pools that consist of two assets. With its state information on assets and bucket sizes, it prices trades using a pricing module. It also checks if trading is allowed or suspended as decided by the on-chain circuit breaker BreakerBox.sol. It can price trades with constant-product or constant-sum as specified in the respective pricing modules. -****[**TradingLimits**](broker/tradinglimits.md) is a library that implements trading limits, used by the Broker. Limits are configurable for 5-minute and 1-day intervals and a total global limit. It is called by the Broker when requesting swaps. The limits exist to protect the protocol against possible economic exploits or smart contract hacks. +[**TradingLimits**](broker/tradinglimits.md) is a library that implements trading limits, used by the Broker. Limits are configurable for 5-minute and 1-day intervals and a total global limit. It is called by the Broker when requesting swaps. The limits exist to protect the protocol against possible economic exploits or smart contract hacks. -****[**BreakerBox**](breakerbox/)****[ ](breakerbox/)is an on-chain circuit breaker for oracles. It maintains a state for each price feed, whether trading is allowed or suspended. It is modular by design and allows for flexible addition and deletion of price feeds and individual breaking logic. Its conditions are checked and breakers are triggered if necessary by newly added rates in SortedOracles.sol. For each requested swap, BiPoolManager.sol checks against this contract whether trading a specific pair is currently allowed or suspended. +[**BreakerBox**](breakerbox/)is an on-chain circuit breaker for oracles. It maintains a state for each price feed, whether trading is allowed or suspended. It is modular by design and allows for flexible addition and deletion of price feeds and individual breaking logic. Its conditions are checked and breakers are triggered if necessary by newly added rates in SortedOracles.sol. For each requested swap, BiPoolManager.sol checks against this contract whether trading a specific pair is currently allowed or suspended. -****[**MedianDeltaBreaker**](breakerbox/mediandeltabreaker.md) is a circuit breaker that trips if the median oracle report changes by a configured threshold. +[**MedianDeltaBreaker**](breakerbox/mediandeltabreaker.md) is a circuit breaker that trips if the median oracle report changes by a configured threshold. -****[**SortedOracles**](sortedoracles.md) stores and maintains the state of oracle reports. Oracle clients insert their rates into a sorted linked list and the contract checks newly inserted rates against the on-chain circuit breaker BreakerBox.sol. If valid, the rate can be used by the protocol to price swaps, otherwise, trading will be halted. +[**SortedOracles**](sortedoracles.md) stores and maintains the state of oracle reports. Oracle clients insert their rates into a sorted linked list and the contract checks newly inserted rates against the on-chain circuit breaker BreakerBox.sol. If valid, the rate can be used by the protocol to price swaps, otherwise, trading will be halted. -****[**StableToken**](stabletoken.md) implements ERC-20 tokens and Celo-specific features for stable assets. Each stable asset has its own contract, with StableToken.sol for the Celo Dollar, StableTokenEUR.sol for the Celo Euro, and so forth for new stable assets. +[**StableToken**](stabletoken.md) implements ERC-20 tokens and Celo-specific features for stable assets. Each stable asset has its own contract, with StableToken.sol for the Celo Dollar, StableTokenEUR.sol for the Celo Euro, and so forth for new stable assets. -****[**Reserve**](reserve.md) **** stores and manages any ERC-20 Mento reserve asset on the Celo blockchain. Assets can be accessed and controlled only by Broker.sol as well as a MultiSig, guarded by trading limits from TradingLimits.sol. +[**Reserve**](reserve.md) stores and manages any ERC-20 Mento reserve asset on the Celo blockchain. Assets can be accessed and controlled only by Broker.sol as well as a MultiSig, guarded by trading limits from TradingLimits.sol. -****[**ConstantProductPricingModule**](iexchangeprovider/bipoolmanager/constantproductpricingmodule.md) is a stateless contract that implements a constant-product pricing formula for a two-asset pool. +[**ConstantProductPricingModule**](iexchangeprovider/bipoolmanager/constantproductpricingmodule.md) is a stateless contract that implements a constant-product pricing formula for a two-asset pool. -****[**ConstantSumPricingModule**](iexchangeprovider/bipoolmanager/constantsumpricingmodule.md) is a stateless contract that implements a constant-sum pricing formula for a two-asset pool. +[**ConstantSumPricingModule**](iexchangeprovider/bipoolmanager/constantsumpricingmodule.md) is a stateless contract that implements a constant-sum pricing formula for a two-asset pool. From 4f08ed8e18691e93d7c0aa45cacf3b534b6550b5 Mon Sep 17 00:00:00 2001 From: Nikolai Kryshnev Date: Sat, 8 Feb 2025 01:30:27 +0300 Subject: [PATCH 5/5] Fix spacing --- developers/running-an-oracle.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developers/running-an-oracle.md b/developers/running-an-oracle.md index 7b0f936..8607377 100644 --- a/developers/running-an-oracle.md +++ b/developers/running-an-oracle.md @@ -1,6 +1,6 @@ # Running an Oracle -Oracles on Celo for Mento are an essential part of the stability mechanism. As of December 2022, there are 10 oracle clients, of which Mento Labs manages 8. There are[ ongoing decentralization efforts to add partners, community members, and validators](https://forum.celo.org/t/decentralized-oracles/3610). As of December 2022, one oracle is operated by a community member, and one by T-Systems MMS, a subsidiary of Deutsche Telekom. +Oracles on Celo for Mento are an essential part of the stability mechanism. As of December 2022, there are 10 oracle clients, of which Mento Labs manages 8. There are[ongoing decentralization efforts to add partners, community members, and validators](https://forum.celo.org/t/decentralized-oracles/3610). As of December 2022, one oracle is operated by a community member, and one by T-Systems MMS, a subsidiary of Deutsche Telekom. The plan is to move these oracles to different entities, ecosystem projects, and potentially even validators of the Celo Protocol, to have community members run the majority of oracles. @@ -12,7 +12,7 @@ In order to run an oracle, you can not have any conflicts of interest and have t ## Oracle client code -The public repository for the oracle client, including technical documentation, can be found[ here](https://github.com/celo-org/celo-oracle) on GitHub. +The public repository for the oracle client, including technical documentation, can be found[here](https://github.com/celo-org/celo-oracle) on GitHub. ## How to get added as an oracle provider