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

Initial implementation for a Compounding function #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alexintosh
Copy link
Member

No description provided.

@dantop114 dantop114 self-requested a review December 20, 2021 12:35
function compound(Claim memory _claim) public notLocked {
_verifyAndMarkClaimed(_claim);

(, int256 price, , uint256 timeStamp, ) = priceFeed.latestRoundData();
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we check for pricefeed activity before pulling prices?
something like checking if the oracle is working as expected

function setTimelock(address _timelock) external onlyOwner
{
sharesTimeLock = ISharesTimeLock(_timelock);
emit TimelockUpdated(address(_timelock));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
emit TimelockUpdated(address(_timelock));
emit TimelockUpdated(_timelock);

function setDoughReserve(address _doughReserve) external onlyOwner
{
doughReserve = _doughReserve:
emit DoughReserveUpdated(address(_doughReserve));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
emit DoughReserveUpdated(address(_doughReserve));
emit DoughReserveUpdated(_doughReserve);

event TimelockUpdated(address newTimelock);
event DoughReserveUpdated(address newDoughReserve);
event DoughUpdated(address newDough);
event Compounded(uint256 sliceAmount, uint256 oraclePrice);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
event Compounded(uint256 sliceAmount, uint256 oraclePrice);
event Compounded(uint256 sliceAmount, uint256 oraclePrice);
event PriceOracleUpdate(address oracle);

Comment on lines +175 to +178
function setSliceVeDoughOracle(uint256 _sliceVedoughOracle) external onlyOwner {
IAggregatorV3Interface priceFeed = IAggregatorV3Interface(_sliceVedoughOracle);
TODO emit
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
function setSliceVeDoughOracle(uint256 _sliceVedoughOracle) external onlyOwner {
IAggregatorV3Interface priceFeed = IAggregatorV3Interface(_sliceVedoughOracle);
TODO emit
}
function setSliceVeDoughOracle(address _sliceVedoughOracle) external onlyOwner {
IAggregatorV3Interface priceFeed = IAggregatorV3Interface(_sliceVedoughOracle);
emit PriceOracleUpdate(_sliceVedoughOracle);
}

IERC20(dough).safeTransferFrom(doughReserve, address(this), amountConverted);
// TODO consider have separate approval
IERC20(dough).safeApprove(address(sharesTimeLock), 0);
IERC20(dough).safeApprove(address(sharesTimeLock), amountConverted);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be safe to only approve amountConverted..

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.

2 participants