Conversation
| function setYieldAccrualDeadline(uint256 _yieldAccrualDeadline) external onlyOwner { | ||
| require(_yieldAccrualDeadline > block.timestamp, "Invalid yield accrual deadline"); | ||
|
|
||
| yieldAccrualDeadline = _yieldAccrualDeadline; | ||
|
|
||
| emit YieldAccrualDeadlineUpdated(_yieldAccrualDeadline); | ||
| } |
There was a problem hiding this comment.
Initially, the accrual deadline is 90 days after the contract deployment. Are we going to call this function again before the 90 days to make it further in the future?
| function stopYieldingRewards() external onlyOwner { | ||
| yieldRewardsFlag = false; | ||
| } | ||
|
|
||
| /// @notice Start the contract accruing rewards | ||
| /// @dev Can only be called by the owner | ||
| function startYieldingRewards() external onlyOwner { | ||
| yieldRewardsFlag = true; | ||
| } |
There was a problem hiding this comment.
Do you think that it might be useful to emit corresponding events?
| function deposit(uint256 assets, address receiver) public virtual override returns (uint256) { | ||
| if (assets <= 0) { | ||
| revert InvalidDepositAmount(); | ||
| } | ||
|
|
||
| if (totalAssets() + assets > maxOverallDeposit) { | ||
| revert MaxOverallDepositReached(); | ||
| } | ||
|
|
||
| refreshForAddress(receiver); | ||
|
|
||
| uint256 shares = super.deposit(assets, receiver); | ||
|
|
||
| UserBalanceMeta storage balanceMeta = userBalanceMeta[receiver]; | ||
|
|
||
| balanceMeta.depositedAmount += assets; | ||
|
|
||
| balanceMeta.lastDepositAt = block.timestamp; | ||
|
|
||
| return shares; | ||
| } |
There was a problem hiding this comment.
Besides checking that the deposit doesn't make the total assets cross the maxOverallDeposit, I think that we should check that the deposit doesn't cross the limit that each address might have via the maxMint(address) function. Am i wrong? Otherwise, one might deposit more that they might be allowed 🤔 ... In other words, maybe the balanceMeta.depositedAmount += assets; should not bring the balanceMeta.depositedAmount in a value which is greater than the maximum amount that an address can deposit based on the maxMint(address) ?
Note
Introduces
TalentVaultV3(ERC4626) with time-locked deposits, configurable yield and limits, plus deployment tooling and comprehensive tests.contracts/talent/TalentVaultV3.sol(ERC4626) with:lockPeriodand per-depositlastDepositAtcheck in_withdraw.yieldRate(only increase),yieldAccrualDeadline, start/stop flags,yieldSource-funded rewards minted via_depositinyieldRewardsandrefresh/refreshForAddress.maxOverallDepositand per-address max viasetMaxMint/removeMaxMintLimit; reverts on zero or exceeding limits.transfer/transferFrom),withdrawAll, and owner-only admin setters.scripts/shared/index.tshelperdeployTalentVaultV3.scripts/talent/deployTalentVaultV3.tsfor Base/Mainnet/Testnet deploy, on-chain address validation, explorer verification, and post-deploy checklist.test/contracts/talent/TalentVaultV3.tscovering deployment, 1:1 conversions, deposit/mint/withdraw/redeem, rewards accrual/pausing, limits, admin-only setters, lock-period enforcement (including bypass attempts), andwithdrawAllbehavior.test/shared/artifacts.tsto includeTalentVaultV3..tool-versionsto includeyarn 1.22.19.Written by Cursor Bugbot for commit ab73740. This will update automatically on new commits. Configure here.