Improvement to *crypto market pool* tutorial

Hey everyone, I was running through the Solidity tutorials provided at . Was doing the practice smart contract deployment on Remix IDE and improved one of those sample smart contracts (

Features added:
Introduced a tenant address, so that vacating a room becomes possible

Only the owner or current tenat can vacate the room

The hotel room rent can be adjusted and is not a static value

Only the owner can change the rent

If excess funds are transferred to the contract, the surplus is returned to the msg.sender

Please have a look, and let me know your thoughts. I am not new to programming, but definitely new to web3 and solidity, I am here to learn.

What do you think?

10 Points
Upvote Downvote

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings


  1. You could probably add more events, a getter function to get the current room status, and move the fallback logic to an occupyRoom function that is called within it instead — people have really moved away from fallback functions being the entrypoint. Otherwise looks pretty good.

Introducing The Daily Gwei

Is TD broken or do I actually owe $1,000,000?