Skip to main content

ExpiringMultiPartyCreator

ExpiringMultiPartyCreator#

Factory contract to create and register new instances of expiring multiparty contracts. Responsible for constraining the parameters used to construct a new EMP. This creator contains a number of constraints that are applied to newly created expiring multi party contract. These constraints can evolve over time and are initially constrained to conservative values in this first iteration. Technically there is nothing in the ExpiringMultiParty contract requiring these constraints. However, because createExpiringMultiParty() is intended to be the only way to create valid financial contracts that are registered with the DVM (via _registerContract), we can enforce deployment configurations here.

Functions#

constructor(address _finderAddress, address _tokenFactoryAddress, address _timerAddress) (public)

Constructs the ExpiringMultiPartyCreator contract.

Parameters:#

  • _finderAddress: UMA protocol Finder used to discover other protocol contracts.
  • _tokenFactoryAddress: ERC20 token factory used to deploy synthetic token instances.
  • _timerAddress: Contract that stores the current time in a testing environment.
createExpiringMultiParty(struct ExpiringMultiPartyCreator.Params params) → address (public)

Creates an instance of expiring multi party and registers it within the registry.

Parameters:#

  • params: is a ConstructorParams object from ExpiringMultiParty.
_getSyntheticDecimals(address _collateralAddress) → uint8 decimals (public)
_preEntranceCheck() (internal)
_preEntranceSet() (internal)
_postEntranceReset() (internal)
setCurrentTime(uint256 time) (external)

Sets the current time.

Will revert if not running in test mode.

Parameters:#

  • time: timestamp to set current Testable time to.
getCurrentTime() → uint256 (public)

Gets the current time. Will return the last time set in setCurrentTime if running in test mode. Otherwise, it will return the block timestamp.

_requireWhitelistedCollateral(address collateralAddress) (internal)
_registerContract(address[] parties, address contractToRegister) (internal)

Events#

CreatedExpiringMultiParty(address expiringMultiPartyAddress, address deployerAddress)

Modifiers#

nonReentrant()

Prevents a contract from calling itself, directly or indirectly. Calling a nonReentrant function from another nonReentrant function is not supported. It is possible to prevent this from happening by making the nonReentrant function external, and making it call a private function that does the actual state modification.

nonReentrantView()

Designed to prevent a view-only method from being re-entered during a call to a nonReentrant() state-changing method.

onlyIfTest()

Reverts if not running in test mode.