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

feat:oracle proper implementation #227

Merged
merged 30 commits into from
Oct 30, 2023
Merged

feat:oracle proper implementation #227

merged 30 commits into from
Oct 30, 2023

Conversation

0xCardinalError
Copy link
Contributor

No description provided.

Copy link
Member

@nugaon nugaon left a comment

Choose a reason for hiding this comment

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

I imagined this like we calculate bitshifted values in the fields and in accessor we shift to the real currentPrice.
will it keep the subtle changes?

src/PriceOracle.sol Outdated Show resolved Hide resolved
@0xCardinalError 0xCardinalError marked this pull request as ready for review October 26, 2023 15:10
Copy link
Member

@nugaon nugaon left a comment

Choose a reason for hiding this comment

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

So when we discussed this, the idea was that giving a separate accessor for currentPrice which is already bitshifted by 10, and the accessor takes this value and shift it back by 10. instead, we have two variables now with which we need to juggle.

src/PriceOracle.sol Outdated Show resolved Hide resolved
src/PriceOracle.sol Outdated Show resolved Hide resolved
@0xCardinalError
Copy link
Contributor Author

So when we discussed this, the idea was that giving a separate accessor for currentPrice which is already bitshifted by 10, and the accessor takes this value and shift it back by 10. instead, we have two variables now with which we need to juggle.

but then values between will be lost.
this way we keep values in decimal
iike 24000.3587 in one round then in next
24000.6788 and then finally in last we have
24001.046
if i dont keep it will be just 24000

Copy link
Member

@nugaon nugaon left a comment

Choose a reason for hiding this comment

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

so now we have currentPriceUpscaled as we discussed, but it could be applied to minimumPrice as well.

src/PriceOracle.sol Outdated Show resolved Hide resolved
test/PostageStamp.test.ts Outdated Show resolved Hide resolved
@0xCardinalError 0xCardinalError merged commit 3df348d into master Oct 30, 2023
1 check passed
@0xCardinalError 0xCardinalError deleted the fix/oracle_update branch October 30, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants