Created
September 10, 2020 13:33
-
-
Save Krishna-Ravi/a8a90806c0c7be375cbecf040f56f169 to your computer and use it in GitHub Desktop.
TrainTicket data storing smart contract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.4.18 <= 0.6.12; | |
contract TrainTickets{ | |
string _from; | |
string _to; | |
string travel_date; | |
string class; | |
string customerName; | |
int phone; | |
int amt; | |
function TrainTickets(string new_from, string new_to, string newtravel_date, | |
string newclass,string newcustomerName, int newphone,int newamt) public { | |
_from = new_from; | |
_to = new_to; | |
travel_date = newtravel_date; | |
class = newclass; | |
customerName =newcustomerName; | |
phone= newphone; | |
amt =newamt; | |
} | |
function getTrainTickets() public view returns(string,string,string,string,string,int,int) { | |
return(_from, _to, travel_date, class,customerName,phone,amt); | |
} | |
function setTrainTickets(string new_from, string new_to, string newtravel_date,string newclass,int newamt) public{ | |
_from = new_from; | |
_to = new_to; | |
travel_date = newtravel_date; | |
class = newclass; | |
amt = newamt; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment