Urgent.News

What's breaking now, across thousands of outlets.

Tech

Vehiclerentalsystem

Building a Vehicle Rental Smart Contract Using Solidity A practical introduction to structs, mappings, modifiers, and booking management in Ethereum smart contracts. Introduction Imagine renting a vehicle without depending entirely on a centralized rental management system. Vehicle information, customer registration, and booking records could be managed through a smart contract, with the rules…

The vehicle rental smart contract uses several key Solidity concepts to manage vehicle records, user information, and booking details. Vehicles are stored in a mapping where the vehicle registration number serves as the unique key. Each vehicle struct contains fields such as registration number, name, rental price, availability status, seating capacity, and ownership address.

Users are similarly stored in a mapping keyed by their Ethereum wallet address. The user struct contains name, age, and phone number fields. Booking information is managed using another mapping with a booking ID as the unique key. The booking struct includes fields such as booking ID, rental start and end times, total amount, vehicle identifier, rented customer address, and current status.

Enumerations are used to define the possible booking statuses like pending, booked, completed, or cancelled. Access control is enforced through modifiers that check whether an operation is authorized based on the sender's role. For example, only the vehicle owner can modify vehicle details, while only registered users can create bookings.

Modifiers simplify the enforcement of these permissions without duplicating access checks in each function. Overall, the contract organizes data and access control using structs, mappings, enums, and modifiers to create a functional prototype for a vehicle rental system on the Ethereum blockchain using Solidity.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

MiniMax H3 Keyframe Control: Timelines, Story Beats, and Custom Samplers

Two ComfyUI graphs ship with this episode. Both are supplied files : no clip was rendered for this article, no timing was taken, and nothing below is a quality comparison.

  • MiniMax H3 FL2VA graph focuses on first and last frames
  • MiniMax H3 Ref2VA graph arranges story beats on timeline
  • Keyframes control motion and story beats without specific settings

Blocking a QA agent: verify the sessions, then try the API

An agent-access switch is useful only if you check what happens beyond the switch. An administrator can see “Blocked” while still needing answers about existing sessions and credentials already issued…

  • Verify session status after blocking QA agent
  • API response check needed post-blocking
  • Distinct phenomena: block vs. expiry

A Simple Spreadsheet-and-Script Workflow for Tracking Many Social Media Accounts

If you manage more than a handful of social media or ad accounts — for clients, for several brands, or for testing campaigns — you've probably hit the moment where "I'll remember it" stops working.

  • Spreadsheet serves as inventory of social media accounts
  • Python script generates daily report of accounts needing attention
  • Password manager stores sensitive account information

Your city chart can name a filter that never took effect

Your regional seller chart can carry a city label for a filter that never took effect. You're preparing the comparison, and DKI Jakarta looks perfectly respectable above a bar.

  • City chart reports a filter that never took effect
  • Discrepancy between city label and actual filter applied
  • Querying correct geography avoids misleading data

More from Monday 2 November →