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
  • Contract Members
  • CallRevert
  • DepositFailed
  • WithdrawFailed
  • Modifiers
  • enoughAllowance
  • Functions
  • getAllowance
  • deposit
  • withdraw
  • setReserveToken
  • safeTransfer
  • safeTransferFrom
  • safeCall
  1. Smart contracts
  2. ABIs documentation

MoCReserve

PreviousMoCPriceProviderMockNextMoCRiskProxManager

Last updated 3 years ago

View Source:

↘ Derived Contracts: ,

MoCReserve - version: 0.1.10

Contract Members

Constants & Variables

contract IERC20 public reserveToken;

uint256[50] private upgradeGap;

CallRevert

Parameters

DepositFailed

Parameters

Name
Type
Description

origin

address

amount

uint256

WithdrawFailed

Parameters

Name
Type
Description

destination

address

amount

uint256

Modifiers

enoughAllowance

modifier enoughAllowance(uint256 amount, address account) internal

Arguments

Name
Type
Description

amount

uint256

account

address

Functions

getAllowance

Returns the amount of token reserve an account is allowed to use for deposit.

function getAllowance(address account) public view
returns(uint256)

Returns

The minimum value between MoC allowance for that account and the account's balance.

Arguments

Name
Type
Description

account

address

User account to check allowance.

deposit

Deposit reserve tokens into MoC address takeing it from origin address. Allowance of the amount should be made it before this.

function deposit(uint256 amount, address origin) internal nonpayable enoughAllowance 
returns(bool)

Arguments

Name
Type
Description

amount

uint256

Amount of reserve tokens to transfer.

origin

address

Account from which to take the funds.

withdraw

Deposit reserve tokens into MoC address takeing it from origin address. Allowance of the amount should be made it before this.

function withdraw(uint256 amount, address destination) internal nonpayable
returns(bool)

Returns

true if transfer is successfull and false if not.

Arguments

Name
Type
Description

amount

uint256

Amount of reserve tokens to extract.

destination

address

Account to which the funds will be sent.

setReserveToken

function setReserveToken(address token) internal nonpayable

Arguments

Name
Type
Description

token

address

safeTransfer

Calls RRC20 transfer function and returns a boolean result even if transaction reverts.

function safeTransfer(address to, uint256 amount) internal nonpayable
returns(bool)

Arguments

Name
Type
Description

to

address

Destination account of the funds.

amount

uint256

Funds to move.

safeTransferFrom

Calls RRC20 transferFrom function and returns a boolean result even if transaction reverts

function safeTransferFrom(address origin, uint256 amount) internal nonpayable
returns(bool)

Arguments

Name
Type
Description

origin

address

Destination account of the funds.

amount

uint256

Funds to move.

safeCall

Wraps an RRC20 transfer with a low level call to handle revert secenario Emits CallRevert if call fails for revert

function safeCall(bytes callData) internal nonpayable
returns(bool)

Arguments

Name
Type
Description

callData

bytes

Packed encoded data to use as call parameter.

contracts/base/MoCReserve.sol
MoC
MoCEvents
enoughAllowance
getAllowance(address account)
deposit(uint256 amount, address origin)
withdraw(uint256 amount, address destination)
setReserveToken(address token)
safeTransfer(address to, uint256 amount)
safeTransferFrom(address origin, uint256 amount)
safeCall(bytes callData)