sebayaki.eth pfp
sebayaki.eth

@if

looks good overall, but I found a few potential issues: 1. ```vy def _fundedUntil() -> uint256: return ( self.liabilitiesLastUpdated + (staticcall STAKED_TOKEN_ADDRESS.balanceOf(self) - self.liabilities) // max(self.totalPayoutPerSlot, 1) ``` If the contract’s balance of the staked token `balanceOf(self)` is less than the total liabilities `self.liabilities`, the subtraction will underflow, causing a revert on `_unstake` method. It might be okay, but it would be better to handle it properly. 2. ```vy def stake(amount: uint256): ``` A user can stake an amount of 0, which could cause potential issues in other parts. I think adding an assertion `assert amount > 0` if staking a zero amount is not intended.
0 reply
0 recast
0 reaction