DEV Community

Cover image for Rent house with my smartcontract on XDC Network
MahaLakshmi Perumal
MahaLakshmi Perumal

Posted on

Rent house with my smartcontract on XDC Network

The development environment used is XinFin Remix. The program is compiled through this platform and released into a contract. In addition, XinPay is used to create a wallet for the actual test of this experiment.

At the beginning of the program, the items of the contract renewal record are announced, including the address of the tenant, the address of the borrower, the rental time, the price per unit time, whether to rent other items, and whether to purchase insurance.

Next is to deploy the current menu information, and first set the data and information to be recorded as initial values.

The next step is to record the various data information entered by the user and determine whether the remaining balance of the borrower is sufficient to pay the fee. If the borrower has too little balance, it will refuse to rent.

Finally, after the end of the lease, the tenant can withdraw the rent. If the non-tenant account cannot be withdrawn, only the tenant can withdraw the rent.

Discussion (0)