Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(emp): Match synthetic and collateral precision #2145

Merged
merged 39 commits into from
Nov 4, 2020

Conversation

nicholaspai
Copy link
Member

Motivation

Parallels implementation #2119 for the EMP.

Summary

Refactors SyntheticToken creation out of the EMP and into the EMPCreator to save bytecode. Bytecode is added so that EMP contract dynamically sets the SyntheticToken precision based on the collateral token's precision.

Issue(s)

Fixes #2144

Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>

update tests, remove bytecode

Signed-off-by: Nick Pai <npai.nyc@gmail.com>

update liquidator tests

Signed-off-by: Nick Pai <npai.nyc@gmail.com>

wip

Signed-off-by: Nick Pai <npai.nyc@gmail.com>

Revert "wip"

This reverts commit 3820b4f.

Revert "update tests, remove bytecode"

This reverts commit 5c66a42.

update ppm tests

Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@@ -1919,9 +1919,6 @@ contract("PerpetualLiquidatable", function(accounts) {
await syntheticToken.addMinter(USDCLiquidationContract.address);
await syntheticToken.addBurner(USDCLiquidationContract.address);

// Get newly created synthetic token and set it as the global synthetic token.
syntheticToken = await Token.at(await USDCLiquidationContract.tokenCurrency());
Copy link
Member Author

Choose a reason for hiding this comment

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

This is uneccessary since we now create syntheticToken at top of section.

@coveralls
Copy link

coveralls commented Nov 3, 2020

Coverage Status

Coverage decreased (-0.1%) to 93.673% when pulling 021a917 on npai/emp-synth-precision into eb70c38 on master.

Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@mrice32 mrice32 changed the title improve(emp) Match synthetic and collateral precision improve(emp): Match synthetic and collateral precision Nov 3, 2020
Copy link
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@chrismaree chrismaree left a comment

Choose a reason for hiding this comment

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

LGTM! left 2 nit comments

nicholaspai and others added 2 commits November 4, 2020 05:30
…iringMultiPartyCreator.js

Co-authored-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
Signed-off-by: Nick Pai <npai.nyc@gmail.com>
@nicholaspai nicholaspai merged commit dbe0989 into master Nov 4, 2020
@nicholaspai nicholaspai deleted the npai/emp-synth-precision branch November 4, 2020 21:45
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.

EMP: Match synthetic and collateral precision
5 participants