βοΈ[Documentation] Deposit & Rental Smart Contract
Last updated
Last updated
In the evolving landscape of digital real estate transactions, the introduction of a Solidity smart contract for managing security deposits in escrow represents a groundbreaking approach to eliminate rental scams. Solidity, the programming language for Ethereum blockchain, enables the creation of self-executing contracts with the terms directly written into code. In this system, a smart contract acts as a neutral, automated escrow agent, securely holding the tenant's security deposit in a digital wallet until both parties agree to release.
This level of transparency and security in the handling of security deposits could significantly increase trust in online real estate transactions, making the process safer and more reliable for both tenants and landlords. By leveraging the power of blockchain and smart contracts, the real estate rental market can take a significant step towards eliminating scams and fostering a more secure and trustworthy environment for online transactions.
The contract comprises the following key components:
State Variables:
erc20Rnb
: acts as a flat fee ERC20 token, just like ETH for Ethereum transactions.
feeReceiverAddress
: Rentible's address designated to receive transaction fees.
arbitratorAddress
: Rentible's arbitrator address responsible for dispute resolution.
rentDepositReleaseTimeDuration
: Duration until rental deposits are released to landlords.
rentDepositTransferRnbFee
: Fee charged for transferring rental deposits.
rentTransferRnbFee
: Fee charged for monthly rent transactions.
Structs:
RentDepositData
: Struct to store rental deposit details.
Mappings:
rentDepositMapping
: Mapping to track rental deposit data for each tenant-landlord pair.
Events:
PayRentDeposit
: deposit payment initiated by a Tenant to a Landlord beneficiary.
ArbitrationRequested
: Event emitted when arbitration is requested.
ArbitrationResolved
: Event emitted when arbitration is resolved.
RenteeConsentForEarlyRelease
: Event emitted when a Tenant consents to early deposit release.
RentDepositReleasedEarly
: Event emitted upon early release of rental deposit.
DepositClaimed
: Event emitted when a rental deposit is claimed by the Landlord.
MonthlyRentPaid
: Event emitted when monthly rent is paid.
FeeUpdated
: Event emitted when transaction fees are updated.
Constructor:
Initializes the contract with essential parameters including ERC20 token, fee receiver, arbitrator, and fee amounts.
Public Functions:
payRentDeposit
: Allows tenants to pay rental deposits to landlords.
setConsentForEarlyRelease
: Enables tenants to consent to early release of rental deposits.
requestArbitration
: Allows tenants to request arbitration in case of disputes.
resolveArbitration
: Permits the arbitrator to resolve arbitration disputes.
claimDeposit
: Allows landlords to claim rental deposits.
payMonthlyRent
: Enables tenants to pay monthly rent to landlords.
setRentDepositTransferRnbFee
: Updates the service fee for transferring rental deposits.
setRentTransferRnbFee
: Updates the service fee for monthly rent transactions.
Tenants can pay rental deposits to landlords using the payRentDeposit
function. Deposits are released to landlords after a specified duration unless the tenant consents to early release.
Tenants pay monthly rent to landlords using the payMonthlyRent
function. Transaction fees are deducted from the rent amount.
In case of disputes, tenants can request arbitration using the requestArbitration
function. The arbitrator resolves disputes and distributes rental deposits accordingly.