# Code Cleanup for Deprecated BTCX Leveraged Positions (and Bug Fixes)

**URL:** <https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465>\
**Category:** MOC Improvement Proposals\
**Created:** [June 23, 2026, 8:11pm UTC](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465 "2026-06-23T20:11:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbokser](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.moneyonchain.com/jbokser/32/228_2.png) [@jbokser](https://forum.moneyonchain.com/u/jbokser)\
**Post date:** [June 23, 2026, 8:11pm UTC](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465/1 "2026-06-23T20:11:03Z")

</div>

> 📝 `MIP#262702`

## Overview

The _Money on Chain_ protocol previously supported leveraged positions known as BTCX, which were deactivated in February 2023 through the [Technical proposal for removal of leveraged positions](https://forum.moneyonchain.com/t/technical-proposal-for-removal-of-leveraged-positions/308). However, deprecated code related to the daily inrate payment logic for these leveraged positions remains in the codebase, even though this functionality is no longer being used. This cleanup removes the obsolete code, reducing unnecessary complexity and improving code maintainability.

## Proposed Changes

The deprecated code related to leveraged positions inrate payment logic will be removed from the protocol contracts. This cleanup ensures:

- **Gas & Cost Efficiency** : Reduces gas consumption and eliminates daily operational costs for BPRO holders
- **Improved Code Quality** : Cleaner, more maintainable codebase that is easier to read and understand
- **Enhanced Auditability** : Simplified code analysis for security auditors and reduces the attack surface by eliminating unused logic

#### Technical Implementation

> ⚠ Warning: some technical/coding knowledge is necessary to fully understand this document

This code cleanup for _deprecated BTCX leveraged positions_ will be implemented through the changes introduced in the [Remove dailyInratePayment #119](https://github.com/money-on-chain/main-RBTC-contract/pull/119) pull request, which removes unused contract-level code.

### 2. Additional Protocol Improvements

The following changes are independent from the _code cleanup for deprecated BTCX leveraged positions_ and are included in this proposal as protocol maintenance and improvement tasks.

Since a governance upgrade process is already required, these changes can be executed together, reducing operational overhead and avoiding the need for additional governance proposals.

#### 2.1 Non-critical Bug Fix: Unsupported Pegged Token Addresses in ROC Queue Transactions

> ℹ Info: Although non-critical, we will fix it as part of this upgrade to avoid a separate governance proposal and reduce operational overhead.

##### Description

Some functions that enqueue transactions into the _RIF on Chain_ protocol currently allow unsupported pegged token addresses to be passed as arguments. These transactions are known to fail later when pending queue execution is processed, creating unnecessary gas costs for users and delivering the false impression that the operation was supported.

##### Fix

The _RIF on Chain_ queue-enqueue functions will validate that any token address passed as an argument corresponds to a peg token supported by the protocol before accepting the transaction into the queue. This change prevents unsupported pegged token transactions from being queued and avoids later execution failures and unexpected user expense.

## Summary

This proposal improves the long-term maintainability and reliability of the _Money on Chain_ protocol by:

- removing deprecated BTCX leveraged-position code and obsolete daily inrate payment logic
- reducing protocol complexity and improving auditability
- saving gas and eliminating the marginal daily operational costs for BPRO holders
- preventing unsupported pegged token transactions from being queued in the _RIF on Chain_ queue
- avoiding later queue execution failures and unexpected user expenses

Together, these changes simplify the protocol codebase, reduce operational risk, and support better transaction handling for queued operations.

## Governance Process

As with all protocol-level changes, this proposal will be submitted to a **governance vote**.

The upgrade will be executed only after:

1. Proposal approval through governance
2. Deployment of the changer contract
3. Execution of the upgrade transaction

* * *

## Technical Procedure

> ⚠ Warning: some technical/coding knowledge is necessary to fully understand this document.

The upgrade will be executed through a **changer contract** , which will:

- Remove deprecated BTCX leveraged-position code and obsolete daily inrate payment logic from the relevant contracts
- Add validation to queue-enqueue functions so unsupported pegged token addresses cannot be accepted as transaction arguments

* * *

## Changer Contract

### The changer contract to vote would be:

| Name | Address (and link to verified code in RSK blockscout explorer) |
| --- | --- |
| `HardeningII` | [`0x23ceA36Ad14137DFcD3b309ffdbA354588350864`](https://rootstock.blockscout.com/address/0x23ceA36Ad14137DFcD3b309ffdbA354588350864?tab=contract) |

* * *

## Existing Contracts to be upgraded

#### The following contracts are already part of the protocol and will be upgraded for the [code cleanup for deprecated BTCX leveraged positions](#p-974-overview-1):

| Name | Type | Address |
| --- | --- | --- |
| `MocV1` | Proxy | [`0xf773...68370`](https://rootstock.blockscout.com/address/0xf773B590aF754D597770937Fa8ea7AbDf2668370?tab=contract) |
| `MocV1` | Implementation | [`0xa60c...07250`](https://rootstock.blockscout.com/address/0xa60c124c197Ff16162f484A5AAd8691f01c07250?tab=contract) |
| `MocV1` | New implementation | [`0x8cf0...5D226`](https://rootstock.blockscout.com/address/0x8cf0035B1D1BcD6821F563B3DB0530ef59C5D226?tab=contract) |
| `MocStateV1` | Proxy | [`0xb9C4...1e257`](https://rootstock.blockscout.com/address/0xb9C42EFc8ec54490a37cA91c423F7285Fa01e257?tab=contract) |
| `MocStateV1` | Implementation | [`0x1D82...06722`](https://rootstock.blockscout.com/address/0x1D827c823D01Acfa4E15959541e310C5FB506722?tab=contract) |
| `MocStateV1` | New implementation | [`0xF65B...01186`](https://rootstock.blockscout.com/address/0xF65Be577b252a41887e2f1A19b576a0925201186?tab=contract) |
| `MocExchangeV1` | Proxy | [`0x6aCb...49038`](https://rootstock.blockscout.com/address/0x6aCb83bB0281FB847b43cf7dd5e2766BFDF49038?tab=contract) |
| `MocExchangeV1` | Implementation | [`0xFc88...B6FC1`](https://rootstock.blockscout.com/address/0xFc88703c22aeC7E072369D227C063B4D0cAB6FC1?tab=contract) |
| `MocExchangeV1` | New implementation | [`0x9Bfb...1b53C`](https://rootstock.blockscout.com/address/0x9BfbBdb1Bf118E15249bb70460A1f4886511b53C?tab=contract) |
| `MocInrateV1` | Proxy | [`0xc0f9...0A3F3`](https://rootstock.blockscout.com/address/0xc0f9B54c41E3d0587Ce0F7540738d8d649b0A3F3?tab=contract) |
| `MocInrateV1` | Implementation | [`0xe9B1...ac918`](https://rootstock.blockscout.com/address/0xe9B15bE6E7CD575b15A197de6a536f39b32ac918?tab=contract) |
| `MocInrateV1` | New implementation | [`0x2ffc...c031A`](https://rootstock.blockscout.com/address/0x2ffc7eC2a97CAe6E357D288E1a59f5E242dc031A?tab=contract) |
| `MocBProxManagerV1` | Proxy | [`0xC4fB...03b6c`](https://rootstock.blockscout.com/address/0xC4fBFa2270Be87FEe5BC38f7a1Bb6A9415103b6c?tab=contract) |
| `MocBProxManagerV1` | Implementation | [`0xeE35...a4e89`](https://explorer.rootstock.io/address/0xee35b51edf623533a83d3aef8f1518ff67da4e89?tab=contract) |
| `MocBProxManagerV1` | New implementation | [`0xa34f...Bdd5a`](https://rootstock.blockscout.com/address/0xa34f8Ddb234D27FEF1645536Da53674768BBdd5a?tab=contract) |

#### The following contracts are already part of the protocol and will be upgraded for the [2.1 Non-critical Bug Fix: Unsupported Pegged Token Addresses in ROC Queue Transactions](#p-974-h-21-non-critical-bug-fix-unsupported-pegged-token-addresses-in-roc-queue-transactions-5):

| Name | Type | Address |
| --- | --- | --- |
| `RifBucket` | Proxy | [`0xA270...aA36A`](https://rootstock.blockscout.com/address/0xA27024Ed70035E46dba712609fc2Afa1c97aA36A?tab=contract) |
| `RifBucket` | Implementation | [`0x1a27...Fec54`](https://rootstock.blockscout.com/address/0x1a2702D60a8B68b845709155B3d97E1DA85Fec54?tab=contract) |
| `RifBucket` | New implementation | [`0x7D41...d3FdC`](https://rootstock.blockscout.com/address/0x7D41dE4fE6a9C57f13032B4D5489A8b7690d3FdC?tab=contract) |
| `DocBucket` | Proxy | [`0x6975...84661`](https://rootstock.blockscout.com/address/0x697535055Aa7AfD2C280523C7B062b1F05284661?tab=contract) |
| `DocBucket` | Implementation | [`0xF920...F5a9B`](https://rootstock.blockscout.com/address/0xF9208cA168FF7ccAFd120edbf39Cf86b625F5a9B?tab=contract) |
| `DocBucket` | New implementation | [`0x2f5b...b3b66`](https://rootstock.blockscout.com/address/0x2f5b77F2ed6D6947917E4d9746108E26275b3b66?tab=contract) |

* * *

---

<div class="post-metadata">

**Author:** ![jbokser](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.moneyonchain.com/jbokser/32/228_2.png) [@jbokser](https://forum.moneyonchain.com/u/jbokser)\
**Post date:** [June 24, 2026, 5:15pm UTC](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465/2 "2026-06-24T17:15:35Z")

</div>

📣 **Call to MOC holders** : [This proposal](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465) is being voted on. [How to vote Tutorial](https://moneyonchain.com/blog/tutorial-how-to-vote-in-money-on-chain-governance/). Use the [voting site](https://manage.moneyonchain.com/).

📣 **Llamado a los MOC holders** : [Esta propuesta](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465) se está votando. [Tutorial de cómo votar](https://moneyonchain.com/es/blog/tutorial-votar-gobernanza-money-on-chain/). Usar el [sitio de voto](https://manage.moneyonchain.com/).

---

<div class="post-metadata">

**Author:** ![jbokser](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.moneyonchain.com/jbokser/32/228_2.png) [@jbokser](https://forum.moneyonchain.com/u/jbokser)\
**Post date:** [July 2, 2026, 5:19pm UTC](https://forum.moneyonchain.com/t/code-cleanup-for-deprecated-btcx-leveraged-positions-and-bug-fixes/465/3 "2026-07-02T17:19:35Z")

</div>

📣 The voting process is over:

- `28.9%` of the MOC tokens total supply participated in the vote.
- `100%` voted in favor.
- No one vote voted against the proposal.
- The change was successfully implemented.

[TX ID: `0x8f699df3fffc89ef48dacc91f80e2788a4a7f1fa6b6b32a11e83ae95fe1ab9cf`](https://rootstock.blockscout.com/tx/0x8f699df3fffc89ef48dacc91f80e2788a4a7f1fa6b6b32a11e83ae95fe1ab9cf)
