wip
This commit is contained in:
parent
94c4ff05d4
commit
28844ce043
2 changed files with 7 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ contract Harb is ERC20, ERC20Permit {
|
|||
/// @notice Address of the TwabController used to keep track of balances.
|
||||
TwabController public immutable twabController;
|
||||
|
||||
/// @notice Address of the LiquidityManager that mints and burns supply
|
||||
/// @notice Address of the LiquidityManager contract that mints and burns supply
|
||||
address public immutable liquidityManager;
|
||||
|
||||
/* ============ Errors ============ */
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import "./interfaces/IHarb.sol";
|
|||
contract Stake is IStake {
|
||||
|
||||
uint256 internal constant MAX_STAKE = 20; // 20% of HARB supply
|
||||
uint256 internal constant MAX_TAX = 1000; // max 1000% tax
|
||||
uint256 internal constant MAX_TAX = 1000; // max 1000% tax per year
|
||||
uint256 internal constant TAX_RATE_BASE = 100;
|
||||
uint256 internal constant TAX_FLOOR_DURATION = 60 * 60 * 24 * 3; //this duration is the minimum basis for fee calculation, regardless of actual holding time.
|
||||
/**
|
||||
|
|
@ -18,6 +18,7 @@ contract Stake is IStake {
|
|||
error TaxTooLow(address receiver, uint64 taxRateWanted, uint64 taxRateMet, uint256 positionId);
|
||||
error SharesTooLow(address receiver, uint256 assets, uint256 sharesWanted, uint256 minStake);
|
||||
error NoPermission(address requester, address owner);
|
||||
error PossitionNotFound
|
||||
|
||||
|
||||
struct StakingPosition {
|
||||
|
|
@ -69,6 +70,10 @@ contract Stake is IStake {
|
|||
// run through all suggested positions
|
||||
for (uint i = 0; i < positions.length; i++) {
|
||||
StakingPosition pos = positions[i];
|
||||
if (pos.creationTime == 0) {
|
||||
//TODO:
|
||||
revert PossitionNotFound();
|
||||
}
|
||||
// check that tax lower
|
||||
if (taxRate <= pos.perSecondTaxRate) {
|
||||
revert TaxTooLow(receiver, taxRate, pos.perSecondTaxRate, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue