RoC Stable Platform - Collateral RIF Token
  • Introduction
  • RIF On Chain platform
    • Main concepts
    • System states
    • Public actions
      • User actions
      • Process actions
    • Contracts architecture
      • MoC
      • CommissionSplitter
      • MoCState
      • MoCBucketContainer
      • MoCSettlement
      • MoCHelperLib
      • MoCLibConnection
      • MoCConverter
      • MoCExchange
      • MoCConnector
      • MoCRiskProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • RiskProToken
      • StableToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with RoC platform
    • Introduction to RoC
      • The MoC Contract
      • RoC Precisions
      • RoC State Contracts
    • Getting RIFPros
      • Minting RIFPros
      • Redeeming RIFPros
    • Getting USDRIF
      • Minting USDRIF
      • Redeeming USDRIF
        • On Settlement: redeemStableTokenRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeStableToken
        • On Liquidation State: redeemAllStableToken
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official RIF On Chain ABIs
      • Events
      • Example code minting RIFPros
      • Example code minting RIFPros without Truffle
      • Example code redeeming RIFPros
      • Example code redeeming RIFPros without Truffle
      • Example code minting USDRIF
      • Example code redeeming free USDRIF
      • Example code redeeming USDRIF Request
      • Example code redeeming all USDRIF
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • Blockable
      • Blocker
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCInrateRiskproxChanger
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCReserve
      • MoCRiskProxManager
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MocInrateStableChanger
      • MockBlocker
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • PriceProviderChanger
      • PriceProviderMock
      • ReserveToken
      • RiskProToken
      • StableToken
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Parameters of the operation
  • The isAddition parameter
  • The delta parameter
  • Gas limit and gas price
  • Possible failures
  • The contract is paused:
  • Settlement is not ready:
  • Not enough gas:
  • Not active redeemer:
  • Not allowed redeemer:
  • Commissions
  1. Integration with RoC platform
  2. Getting USDRIF
  3. Redeeming USDRIF

On Settlement: alterRedeemRequestAmount

PreviousOn Settlement: redeemStableTokenRequestNextOutside Settlement: redeemFreeStableToken

Last updated 1 year ago

alterRedeemRequestAmount(bool isAddition, uint256 delta) public

There is only at most one redeem request per user during a settlement. A new reedeem request is created if the user invokes it for the first time or updates its value if it already exists.

Parameters of the operation

The isAddition parameter

true if you increase the amount of the redemption order amount, false otherwise.

The delta parameter

It is the amount that the contract will be used to update a USDRIF redeem request amount. This parameter uses a precision of the type reservePrecision that contains 18 decimal places and can be greater than user's balance at request time, allowing to, for example, redeem all future user's USDRIF. If isAddition is false and the delta param is greater than the total amount of the redeem request, then the total amount of the request will be set to 0.

Gas limit and gas price

These two values are a parameter of the transaction, this is not used in the contract and is generally managed by your wallet (you should read about them if you are developing and do not know exactly what they are), but you should take them into account when trying to redeem some USDRIF.

Possible failures

This operation may fail if one of the following scenarios occurs:

The contract is paused:

If the system suffers some type of attack, the contract can be paused so that operations cannot be done and the risk of the users losing their funds with the operation can be minimized. The condition is the same as that explained in .

Settlement is not ready:

The function can only be invoked when the Settlement is finished executing. If called during execution, the transaction reverts with the error message: Function can only be called when settlement is ready.

Not enough gas:

If the gas limit sent is not enough to run all the code needed to execute the transaction, the transaction will revert (again, returning all your funds except the fee paid to the network). This may return an "out of gas" error or simply a "revert" error because of the usage of the proxy pattern.

Not active redeemer:

Not allowed redeemer:

Commissions

When a user tries to update a redeem request, but the system cannot find its address as an active user for the current settlement. It is a rare condition in which a transaction reverts with the error message: This is not an active redeemer. If this situation occurs then you can contact the to help you.

When a user tries to update a redeem request and the system found its address as an active user but redeem request has a different address in the current settlement. It is a very rare condition in which a transaction reverts with the error message: Not allowed redeemer. If this situation occurs then you can contact the to help you.

The alterRedeemRequestAmount operation has no commissions, but when the settlement runs, the total requested amount to redeem will pay commissions. This fee will be the same as the REDEEM_DOC_FEES_RBTC value. The commission fees are explained in section.

The MoC contract is paused
Money on Chain team
Money on Chain team
this