UFragments Contract

contract UFragmentsis DetailedERC20, 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. Source: UFragments.sol

Index


Events

  • LogRebase
    event LogRebase(uint256 epoch, uint256 totalSupply)

    Parameters:
    epoch - uint256
    totalSupply - uint256
  • LogRebasePaused
    event LogRebasePaused(bool paused)

    Parameters:
    paused - bool
  • LogTokenPaused
    event LogTokenPaused(bool paused)

    Parameters:
    paused - bool

Modifiers

  • onlyMonetaryPolicy
    modifier onlyMonetaryPolicy()
  • validRecipient
    modifier validRecipient(address to)
  • whenRebaseNotPaused
    modifier whenRebaseNotPaused()
  • whenTokenNotPaused
    modifier whenTokenNotPaused()

Functions

  • allowance
    function allowance(address owner, address spender) public view returns (uint256)

    Function to check the amount of tokens that an owner has allowed to a spender.

    Parameters:
    owner - The address which owns the funds.
    spender - The address which will spend the funds.
    Returns:

    The number of tokens still available for the spender.

  • approve
    function approve(address spender, uint256 value) public returns (bool)

    Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    spender - The address which will spend the funds.
    value - The amount of tokens to be spent.
    Returns:
    bool.
  • balanceOf
    function balanceOf(address who) public view returns (uint256)
    Parameters:
    who - The address to query.
    Returns:
    The balance of the specified address.
  • decreaseApproval
    function decreaseApproval(address spender, uint256 subtractedValue) public returns (bool)

    Decrease the amount of tokens that an owner has allowed to a spender. * approve should be called when allowed[spender] == 0. To decrement allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    spender - The address which will spend the funds.
    subtractedValue - The amount of tokens to decrease the allowance by.
    Returns:
    bool.
  • increaseApproval
    function increaseApproval(address spender, uint256 addedValue) public returns (bool)

    Increase the amount of tokens that an owner has allowed to a spender. * approve should be called when allowed[spender] == 0. To increment allowed value is better to use this function to avoid 2 calls (and wait until the first transaction is mined) From MonolithDAO Token.sol.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    spender - The address which will spend the funds.
    addedValue - The amount of tokens to increase the allowance by.
    Returns:
    bool.
  • initialize
    function initialize(address owner) public

    Modifiers:
    isInitializer
    Parameters:
    owner - address
  • rebase
    function rebase(uint256 epoch, int256 supplyDelta) external

    Notifies Fragments contract about a new rebase cycle.


    Modifiers:
    onlyMonetaryPolicy whenRebaseNotPaused
    Parameters:
    epoch - uint256
    supplyDelta - The number of new fragment tokens to add into circulation via expansion.
  • setMonetaryPolicy
    function setMonetaryPolicy(address monetaryPolicy_) external

    Modifiers:
    onlyOwner
    Parameters:
    monetaryPolicy_ - The address of the monetary policy contract to use for authz.
  • setRebasePaused
    function setRebasePaused(bool paused) external

    Pauses or unpauses the execution of rebase operations.

    Modifiers:
    onlyOwner
    Parameters:
    paused - Pauses rebase operations if this is true.
  • setTokenPaused
    function setTokenPaused(bool paused) external

    Pauses or unpauses execution of ERC-20 transactions.

    Modifiers:
    onlyOwner
    Parameters:
    paused - Pauses ERC-20 transactions if this is true.
  • totalSupply
    function totalSupply() public view returns (uint256)

    Returns:
    The total number of fragments.
  • transfer
    function transfer(address to, uint256 value) public returns (bool)

    Transfer tokens to a specified address.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    to - The address to transfer to.
    value - The amount to be transferred.
    Returns:
    True on success, false otherwise.
  • transferFrom
    function transferFrom(address from, address to, uint256 value) public returns (bool)

    Transfer tokens from one address to another.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    from - The address you want to send tokens from.
    to - The address you want to transfer to.
    value - The amount of tokens to be transferred.
    Returns:
    bool