Skip to content

Conversation

@evmbro
Copy link
Member

@evmbro evmbro commented Feb 27, 2022

No description provided.

@evmbro evmbro requested a review from githinho February 27, 2022 18:12
@linear
Copy link

linear bot commented Feb 27, 2022

Comment on lines 64 to 66
address fetchedIssuer = _safe_issuer_fetch(params.asset);
address issuerProcessed = fetchedIssuer != address(0) ? fetchedIssuer : params.issuer;
require(issuerProcessed != address(0), "CfManagerSoftcapVesting: Invalid issuer.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could potentially cause problems because the user can define issuer in params but another issuer is set in the constructor. Maybe add require to this logic.

Comment on lines 68 to 74
uint256 fetchedPricePrecision = _safe_price_precision_fetch(params.asset);
uint256 pricePrecisionProcessed = fetchedPricePrecision > 0 ? fetchedPricePrecision : params.tokenPricePrecision;
require(pricePrecisionProcessed > 0, "CfManagerSoftcapVesting: Invalid price precision.");

address paymentMethodProcessed = params.paymentMethod == address(0) ?
IIssuerCommon(issuerProcessed).commonState().stablecoin :
params.paymentMethod;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same as above. Not sure what we get by restricting the payment method to issuer stablecoin

evmbro and others added 9 commits March 2, 2022 10:54
* decouple campaign price from asset state

removed the tokenPricePrecision property from assets

use priceDecimals rather than price precision (use 4, not 10**4)

provide priceDecimals as a parameter while creating campaign

provide priceDecimals as a parameter while updateing price on ApxRegistry (important for liquidations)

track priceDecimals when storing the highestSellPrice on asset state (important for liquidations)

make all the _token_value() methods look the same (operations ordering)

fix tests

add priceDecimalsPrecision to the campaign common state

fix deployer service scripts to take into account new priceDecimals parameter when creating campaigns

* PR fixes

* PR fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants