When interacting with smart contracts on the Ethereum blockchain, the Ethereum web3 API or JSON-API interface uses the contract's application binary interface (ABI) as the standard way to encode and decode the methods we call, as well as the input and output data. The same applies to calls from outside of the blockchain and calls between contracts. Data is encoded according to its type, as described in the ABI specification.
All the functions and events within the smart contract can be described using JSON descriptors, as shown in the following screenshot. A JSON description of the deposit (_tenant string memory) method is shown in the red box, while the RentPaid event is shown in the purple box:
When the deposit method is called, it will generate a function selector, which is calculated as the first 4 bytes of the keccak256...