Movie Renting

Contract purpose

This smart contract manages movie renting for a store or a website that offers this kind of service.

Exposed methods and variables

manager ethereum address of the store manager, given as parameter at contract creation

addMovie called by the manager when he wants to add a new movie for renting

parameter nametypedetails
_refNrintegerthe reference number for the movie (unique for each record)
_titlestringthe movie title
_lengthintegerthe length of the movie ( number of minutes)
_releaseYearintegerthe release year of the movie
_priceintegerthe amount the client needs to pay to rent the movie

rentMovie payable function called by the client when he wants to rent a specific movie

parameter nametypedetails
_refNrintegerthe reference number for the movie to be rented

movieAvailable allows the manager to mark as available a previously rented movie

parameter nametypedetails
_refNrintegerthe reference number for the movie to be made available

getMovieDetails returns the details about a particular movie

parameter nametypedetails
_refNrintegerthe reference number for the movie to be queried

transferMoney allows the manager to transfer money from the contract's balance to his own account

parameter nametypedetails
amountintegerthe sum the manager wants to transfer

getBalance returns the balance of the contract when called by the manager

Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract