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

Introduces StableYield contract for minting and distributing reward per app per period #167

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vzotova
Copy link
Contributor

@vzotova vzotova commented Apr 3, 2024

StableYield contract helps to automatize reward distribution. This level allows periodic minting and sending reward to distributor which can be Merkle tree or application itself (TACo app)

import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";

/// @title Stable yield contract
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// @title Stable yield contract
/// @title StableYield contract

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

view
returns (uint96 reward)
{
uint96 authrorizedOverall = tokenStaking.getAuthorizedOverall(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
uint96 authrorizedOverall = tokenStaking.getAuthorizedOverall(
uint96 authorizedOverall = tokenStaking.getAuthorizedOverall(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

distributor.functionCall(data);
}

function caclulateReward(address application, uint256 stableYield)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
function caclulateReward(address application, uint256 stableYield)
function caculateReward(address application, uint256 stableYield)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

✔️

}

function sendToDistributor(address distributor, uint96 reward) internal {
token.mint(distributor, reward);
Copy link
Member

Choose a reason for hiding this comment

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

Given the criticality of minting tokens, what do you think if we add a manual approval step (e.g., from the council multisig)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping to have mintAndPush as permissionless method. Can you elaborate how this will work with council? in which moment? Like sort of queue?

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