Skip to content

Instantly share code, notes, and snippets.

@Krishna-Ravi
Created September 10, 2020 13:33
Show Gist options
  • Save Krishna-Ravi/a8a90806c0c7be375cbecf040f56f169 to your computer and use it in GitHub Desktop.
Save Krishna-Ravi/a8a90806c0c7be375cbecf040f56f169 to your computer and use it in GitHub Desktop.
TrainTicket data storing smart contract
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