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
- LogMonetaryPolicyUpdatedevent LogMonetaryPolicyUpdated(address monetaryPolicy)Parameters:monetaryPolicy - address
- LogRebaseevent LogRebase(uint256 epoch, uint256 totalSupply)Parameters:epoch - uint256
totalSupply - uint256
- LogRebasePausedevent LogRebasePaused(bool paused)Parameters:paused - bool
- LogTokenPausedevent LogTokenPaused(bool paused)Parameters:paused - bool
- onlyMonetaryPolicymodifier onlyMonetaryPolicy()
- validRecipientmodifier validRecipient(address to)
- whenRebaseNotPausedmodifier whenRebaseNotPaused()
- whenTokenNotPausedmodifier whenTokenNotPaused()
- allowancefunction 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.
- approvefunction 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:Parameters:spender - address.
value - The amount of tokens to be spent.Returns:bool.
- balanceOffunction balanceOf(address who) public view returns (uint256)Parameters:who - The address to query.Returns:The balance of the specified address.
- decreaseAllowancefunction 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:Parameters:spender - The address which will spend the funds.
subtractedValue - The amount of tokens to decrease the allowance by.Returns:bool.
- increaseAllowancefunction 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:Parameters:spender - The address which will spend the funds.
addedValue - The amount of tokens to increase the allowance by.Returns:bool.
- initializefunction initialize(address owner_) publicModifiers:Parameters:owner_ - address
- rebasefunction rebase(uint256 epoch, int256 supplyDelta) external
Notifies Fragments contract about a new rebase cycle.Modifiers:Parameters:epoch - uint256
supplyDelta - The number of new fragment tokens to add into circulation via expansion.
- setMonetaryPolicyfunction setMonetaryPolicy(address monetaryPolicy_) externalModifiers:Parameters:monetaryPolicy_ - The address of the monetary policy contract to use for authentication.
- setRebasePausedfunction setRebasePaused(bool paused) external
Pauses or unpauses the execution of rebase operations.Modifiers:Parameters:paused - Pauses rebase operations if this is true.
- setTokenPausedfunction setTokenPaused(bool paused) external
Pauses or unpauses execution of ERC-20 transactions.Modifiers:Parameters:paused - Pauses ERC-20 transactions if this is true.
- totalSupplyfunction totalSupply() public view returns (uint256)Returns:The total number of fragments.
- transferfunction transfer(address to, uint256 value) public returns (bool)
Transfer tokens to a specified address.Modifiers:Parameters:to - The address to transfer to.
value - The amount to be transferred.Returns:True on success, false otherwise.
- transferFromfunction transferFrom(address from, address to, uint256 value) public returns (bool)
Transfer tokens from one address to another.Modifiers: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