Financial contract with priceless position management.
constructor(bool _isTest, uint256 _expirationTimestamp, uint256 _withdrawalLiveness, address _collateralAddress, address _finderAddress, bytes32 _priceIdentifier, string _syntheticName, string _syntheticSymbol, address _tokenFactoryAddress, struct FixedPoint.Unsigned _minSponsorTokens) public
Construct the PricelessPositionManager
_isTest: whether this contract is being constructed for the purpose of running tests.
_expirationTimestamp: unix timestamp of when the contract will expire.
_withdrawalLiveness: liveness delay, in seconds, for pending withdrawals.
_collateralAddress: ERC20 token used as collateral for all positions.
_finderAddress: UMA protocol Finder used to discover other protocol contracts.
_priceIdentifier: registered in the DVM for the synthetic.
_syntheticName: name for the token contract that will be deployed.
_syntheticSymbol: symbol for the token contract that will be deployed.
_tokenFactoryAddress: deployed UMA token factory to create the synthetic token.
Transfers ownership of the caller’s current position to
Transferring positions can only occur if the recipient does not already have a position.
newSponsorAddress: is the address to which the position will be transferred.
collateralCurrency into the sponsor’s position.
Increases the collateralization level of a position after creation.
collateralAmount: total amount of collateral tokens to be sent to the sponsor’s position.
collateralCurrency from the sponsor’s position to the sponsor.
Reverts if the withdrawal puts this position’s collateralization ratio below the global
collateralization ratio. In that case, use
collateralAmount: is the amount of collateral to withdraw
Starts a withdrawal request that, if passed, allows the sponsor to withdraw
collateralAmount from their position.
The request will be pending for
withdrawalLiveness, during which the position can be liquidated.
collateralAmount: the amount of collateral requested to withdraw
After a passed withdrawal request (i.e., by a call to
requestWithdrawal and waiting
positionData.withdrawalRequestAmount of collateral currency.
collateralAmount into the sponsor’s position and mints
Reverts if the minting these tokens would put the position’s collateralization ratio below the global collateralization ratio.
collateralAmount: is the number of collateral tokens to collateralize the position with
numTokens: is the number of tokens to mint from the position.
tokenCurrency and sends back the proportional amount of
Can only be called by a token sponsor.
numTokens: is the number of tokens to be burnt for a commensurate amount of collateral.
After a contract has passed expiry all token holders can redeem their tokens for
underlying at the prevailing price defined by the DVM from the
This Burns all tokens from the caller of
tokenCurrency and sends back the proportional
Locks contract state in expired and requests oracle price.
this function can only be called once the contract is expired and cant be re-called due to the state modifiers applied on it.
Premature contract settlement under emergency circumstances.
Only the governor can call this function as they are permissioned within the
Upon emergency shutdown, the contract settlement time is set to the shutdown time. This enables withdrawal
to occur via the standard
settleExpired function. Contract state is set to
which prevents re-entry into this function or the
expire function. No fees are paid when calling
emergencyShutdown as the governor who would call the function would also receive the fees.
Accessor method for a sponsor’s collateral.
This is necessary because the struct returned by the positions() method shows rawCollateral, which isn’t a user-readable value.
sponsor: address whose collateral amount is retrieved.
Accessor method for the total collateral stored within the PricelessPositionManager.
This overrides pfc() so the PricelessPositionManager can report its profit from corruption.
_reduceSponsorPosition(address sponsor, struct FixedPoint.Unsigned tokensToRemove, struct FixedPoint.Unsigned collateralToRemove, struct FixedPoint.Unsigned withdrawalAmountToRemove) internal
Sets the current time.
Will revert if not running in test mode.
Gets the current time. Will return the last time set in
setCurrentTime if running in test mode.
Otherwise, it will return the block timestamp.