`assert condition, "message"` reverts the whole transaction (refunding remaining gas in modern EVM versions) if the condition is false, and includes the message as the revert reason. `raise "message"` reverts unconditionally.
@external
def withdraw(amount: uint256):
assert amount <= self.balances[msg.sender], "insufficient balance"
self.balances[msg.sender] -= amount
send(msg.sender, amount)
@external
def admin_only():
if msg.sender != self.owner:
raise "not owner"Vyper does not have Solidity-style custom error types (`error Foo()`); string reasons are the standard way to communicate failure.