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

Supply Sync #16

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Supply Sync #16

wants to merge 3 commits into from

Conversation

oldchili
Copy link
Collaborator

No description provided.


/// MkrSky.sol -- Mkr/Sky Exchanger

// Copyright (C) 2023 Dai Foundation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shoulde be 2024

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

GemLike public immutable mkr;
GemLike public immutable sky;

constructor(address mkr_, address sky_, address owner) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Considering the converter doesn't have the conversion value hardcoded, I wouldn't do it here. My suggestion would be to actually pass the converter as the constructor param, and then you have the 3 values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok done

unchecked {
if (mkrSupplyInSky > skyBalance) {
sky.mint(address(this), mkrSupplyInSky - skyBalance);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I'd prefer an elseif, so we avoid to burn 0 if sync is called multiple times. But it is really a very subjective thing, not really important gas wise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, changed to that and also added return values so it's easier to use it in a bot/cron-job.

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