> For the complete documentation index, see [llms.txt](https://docs.moneyonchain.com/main-rbtc-contract/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moneyonchain.com/main-rbtc-contract/money-on-chain-platform/contracts-architecture/mocsettlement.md).

# MoCSettlement

* Referenced by: MoC, MoCState
* References/uses: Math, SafeMath, MoCBase, DocToken, MoCState, MoCExchange, MoCBProxManager, MoC
* Inherits from: MoCBase

This contract handles settlement logic and stores redeem request collection. It uses both `lastProcessedBlock` and `blockSpan` to periodically allow one execution.

* State:
  * Last Processed Block: Block Number of the last successful execution `uint256 internal lastProcessedBlock;`
  * Block Span: Set by configuration, min number of blocks settlement should be re-evaluated on, this should be adjusted according network mining rate to hit the target time `uint256 internal blockSpan;`
  * Redeem request collection: tracks accounts with active redeem request for next settlement

```
struct RedeemRequest {
  address who;
  uint256 amount;
}
RedeemRequest[] private redeemQueue;
uint256 private numElements = 0;
```
