UFragments Policy Contract

contract UFragmentsPolicyis Ownable

This contract is an implementation of the uFragments Ideal Money protocol. uFragments operates symmetrically on expansion and contraction. It will both split and combine coins to maintain a stable unit price. This component regulates the token supply of the uFragments ERC20 token in response to market oracles. Source: UFragmentsPolicy.sol

Index


Events

  • LogRebase
    event LogRebase(uint256 epoch, uint256 exchangeRate, uint256 cpi, int256 requestedSupplyAdjustment, uint256 timestampSec)

    Parameters:
    epoch - uint256
    exchangeRate - uint256
    cpi - uint256
    requestedSupplyAdjustment - int256
    timestampSec - uint256

Functions

  • inRebaseWindow
    function inRebaseWindow() public view returns (bool)

    Returns: If the latest block timestamp is within the rebase time window it, returns true. Otherwise, returns false.

  • initialize
    function initialize(address owner, UFragments _uFrags, uint256 baseCpi_) public

    ZOS upgradable contract initialization method, called at the time of contract creation. This is where parent class initializers are invloked and contract storage variables are set with initial values.

    Modifiers:
    isInitializer
    Parameters:
    owner - address
    _uFrags - UFragments
    baseCpi_ - uint256
  • rebase
    function rebase() external

    The supply adjustment equals (_totalSupply * DeviationFromTargetRate) / rebaseLag Where DeviationFromTargetRate is (MarketOracleRate - targetRate) / targetRate and targetRate is CpiOracleRate / baseCpi, Anyone can call this function to initiate a new rebase operation, provided more than the minimum time period has elapsed.

  • setCpiOracle
    function setCpiOracle(IOracle cpiOracle_) external

    Sets the reference to the CPI oracle.

    Modifiers:
    onlyOwner
    Parameters:
    cpiOracle_ - The address of the cpi oracle contract.
  • setDeviationThreshold
    function setDeviationThreshold(uint256 deviationThreshold_) external

    Sets the deviation threshold fraction. If the exchange rate given by the market oracle is within this fractional distance from the targetRate, then no supply modifications are made. DECIMALS fixed point number.

    Modifiers:
    onlyOwner
    Parameters:
    deviationThreshold_ - The new exchange rate threshold.
  • setMarketOracle
    function setMarketOracle(IOracle marketOracle_) external

    Sets the reference to the market oracle.

    Modifiers:
    onlyOwner
    Parameters:
    marketOracle_ - The address of the market oracle contract.
  • setRebaseLag
    function setRebaseLag(uint32 rebaseLag_) external

    Sets the rebase lag parameter. It is used to dampen the applied supply adjustment by 1 / rebaseLag If the rebase lag R, equals 1, the smallest value for R, then the full supply correction is applied on each rebase cycle. If it is greater than 1, then a correction of 1/R of is applied on each rebase.

    Modifiers:
    onlyOwner
    Parameters:
    _rebaseLag - The new lag period for rebasing.
  • setRebaseTimingParameters
    function setRebaseTimingParameters(uint256 minRebaseTimeIntervalSec_, uint256 rebaseWindowOffsetSec_, uint256 rebaseWindowLengthSec_) external

    Sets the parameters which control the timing and frequency of rebase operations. a) the minimum time period that must elapse between rebase cycles. b) the rebase window offset parameter. c) the rebase window length parameter.

    Modifiers:
    onlyOwner
    Parameters:
    minRebaseTimeIntervalSec_ - More than this much time must pass between rebase operations, in seconds.
    rebaseWindowOffsetSec__ - The number of seconds from the beginning of the rebase interval, where the rebase window begins.
    rebaseWindowLengthSec_ - The length of the rebase window in seconds.