-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: master
Are you sure you want to change the base?
Conversation
function compound(Claim memory _claim) public notLocked { | ||
_verifyAndMarkClaimed(_claim); | ||
|
||
(, int256 price, , uint256 timeStamp, ) = priceFeed.latestRoundData(); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emit TimelockUpdated(address(_timelock)); | |
emit TimelockUpdated(_timelock); |
function setDoughReserve(address _doughReserve) external onlyOwner | ||
{ | ||
doughReserve = _doughReserve: | ||
emit DoughReserveUpdated(address(_doughReserve)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event Compounded(uint256 sliceAmount, uint256 oraclePrice); | |
event Compounded(uint256 sliceAmount, uint256 oraclePrice); | |
event PriceOracleUpdate(address oracle); |
function setSliceVeDoughOracle(uint256 _sliceVedoughOracle) external onlyOwner { | ||
IAggregatorV3Interface priceFeed = IAggregatorV3Interface(_sliceVedoughOracle); | ||
TODO emit | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
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
..
No description provided.