I'm learning SmartPy and I'm trying to make a simple escrow contract. I read that
contract.balance can be used to access the balance of a contract. In that case, how would I go about receiving XTZ to the contract's balance and sending it from the contract's balance?
To receive XTZ, you simply avoid refusing it: you need an entry_point that will simply accept XTZ by literally not sending an exception.
You can see the number of XTZ sent by looking at
To send XTZ, you need to use either
sp.send for simple XTZ transfers or
sp.transfer for general transfers.
See https://smartpy.io/reference.html#_contracts_and_addresses for the details.