```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("unit or base unit must be defined")
    if unit == base:
        return amount
    if not isinstance(defs[unit][0], int) or defs[unit][0] <= 0:
        raise ValueError("factor must be a positive whole number")
    if defs[unit][1] not in defs:
        raise ValueError(" finer unit must be defined")
    if defs[unit][0] == 0:
        raise ValueError("factor cannot be zero")
    if defs[defs[unit][1]][0] == 0:
        raise ValueError("factor cannot be zero")
    if defs[defs[unit][1]][0] == 1 and defs[defs[unit][1]][1] == 0:
        raise ValueError("factor and finer unit cannot both be 1")
    if unit == defs[unit][1]:
        raise ValueError("unit and finer unit cannot be the same")
    if unit in defs and defs[unit][1] in defs and defs[unit][0] != 0 and defs[defs[unit][1]][0] != 0:
        return amount * defs[unit][0] * base_amount(amount // defs[unit][0], defs[unit][1], defs, base)
    raise ValueError("chain loops")
```