-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The pre‑flight checks only consider "active" balance when some tokens are frozen; if no tokens are frozen, the activebalance check always returns true, and the functions do not verify total balance. This can yield true while a real
transfer reverts due to insufficient ERC‑20 balance.
While it is intended, we may want to change this in the future
// contracts/modules/internal/ERC20EnforcementModuleInternal.sol
function _checkActiveBalance(address from, uint256 value) internal view returns(bool){
uint256 frozenTokensLocal = _getFrozenTokens(from);
if(frozenTokensLocal > 0 ){
uint256 activeBalance = ERC20Upgradeable.balanceOf(from) - frozenTokensLocal;
if(value > activeBalance) {
return false; // Only enforced when some tokens are frozen
}
}
return true; // No check at all when frozenTokensLocal == 0
}
Reported by Nethermind AuditAgent
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request