Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
UMA Long Short Pair Contract Creator
copy icon
UMA
• version 1.0.0
Pair
Finance
Utility
Factory
Audited

UMA Long Short Pair Contract Creator

Audited

Factory contract to create new instances of long short pair contracts. Responsible for constraining the parameters used to construct a new LSP. These constraints can evolve over time and are initially constrained to conservative values in this first iteration.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

UMA

Recent Use

🍞 0x7015 downloaded

Last Publish

11/5/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
createLongShortPair() :
This function creates a LongShortPair, which is a type of synthetic token pair. It takes in a set of parameters (CreatorParams memory params) which include the names and symbols of the long and short synthetic tokens, as well as the address of the collateral token. It then creates two ExpandedIERC20 tokens, one for the long synthetic token and one for the short synthetic token, using the tokenFactory. It then creates a LongShortPair using the converted parameters and the addresses of the two tokens. Finally, it adds the LongShortPair address as a minter and burner for both tokens, and sets the LongShortPair address as the owner of both tokens. It then emits an event to (autogenerated documentation)
_convertParams() :
This function is used to convert the parameters passed in by the creator of a LongShortPair into the parameters needed by the LongShortPair constructor. It takes in the CreatorParams memory creatorParams, ExpandedIERC20 longToken, and ExpandedIERC20 shortToken as inputs and returns a LongShortPair.ConstructorParams memory constructorParams as output. The function sets the pairName, expirationTimestamp, collateralPerPair, priceIdentifier, enableEarlyExpiration, collateralToken, financialProductLibrary, customAncillaryData, proposerReward, optimisticOracleLivenessTime, and optimisticOracleProposerBond fields of the constructorParams to the corresponding values from the creator (autogenerated documentation)
_getSyntheticDecimals() :
This function is used to get the number of decimals associated with a given ERC20 token. It does this by attempting to call the decimals() function of the token, and if it fails, it returns a default value of 18. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i uma-long-short-pair-creator
copy icon

Recent Use

🍞 0x7015 downloaded

Last Publish

11/5/2022

Version

1.0.0

Creator

UMA

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.