```python
def base_amount(amount: int, unit: str, defs: dict, base: str) -> int:
    if isinstance(amount, bool) or not isinstance(amount, int) or amount < 0:
        raise ValueError("amount must be a non-negative integer")
    if unit not in defs or base not in defs:
        raise ValueError("unknown unit or base")
    if not isinstance(defs[unit][0], int) or defs[unit][0] <= 0:
        raise ValueError("bad factor")
    if not isinstance(defs[unit][1], str) or defs[unit][1] not in defs:
        raise ValueError("unknown finer unit")
    if defs[unit][1] == base:
        return amount
    if defs[unit][1] not in defs:
        raise ValueError("loop in definition chain")
    return base_amount(amount * defs[unit][0], defs[unit][1], defs, base)
```