UFragments Contract

contract UFragmentsis ERC20Detailed, Ownable

This is part of an implementation of the uFragments Ideal Money protocol. uFragments is a normal ERC20 token, but its supply can be adjusted by splitting and combining tokens proportionally across all wallets. * uFragment balances are internally represented with a hidden denomination, 'gons'. We support splitting the currency in expansion and combining the currency on contraction by changing the exchange rate between the hidden 'gons' and the public 'fragments'. Source: UFragments.sol

Index


Events

  • LogMonetaryPolicyUpdated
    event LogMonetaryPolicyUpdated(address monetaryPolicy)

    Parameters:
    monetaryPolicy - address
  • 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. This method is included for ERC20 compatibility. increaseAllowance and decreaseAllowance should be used instead. Changing an allowance with this method brings the risk that someone may transfer both the old and the new allowance - if they are both greater than zero - if a transfer transaction is mined before the later approve() call is mined. * @param spender The address which will spend the funds.

    Modifiers:
    whenTokenNotPaused
    Parameters:
    spender - address.
    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.
  • decreaseAllowance
    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool)

    Decrease the amount of tokens that an owner has allowed to a spender. * @param spender The address which will spend the funds.

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

    Increase the amount of tokens that an owner has allowed to a spender. This method should be used instead of approve() to avoid the double approval vulnerability described above.

    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 authentication.
  • 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