Skip to content

Instantly share code, notes, and snippets.

@5p4r70n
Created July 2, 2019 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5p4r70n/b513a1cd51ee208f7c86147713969847 to your computer and use it in GitHub Desktop.
Save 5p4r70n/b513a1cd51ee208f7c86147713969847 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
pragma solidity ^0.5.0;
contract CaseReg{
enum CType {Criminal,Civil,Narcotic,Terririst}
uint public Pgno = 0 ; // it will increase while adding each case
struct Petition {
string Prathy; //Accuse
string Vaadi; //mattavan
string Tittle; //vishayam
CType Casetype; // as 0-3 based on above enum
string Image; //ipfs image hash
string WriteUp; //blaa blaaa blaaa
}
mapping(uint=>Petition) public MPetition; //going to map the petition struct via page no
function AddPetition (string memory _Prathy,string memory _Vaadi,string memory _Tittle,CType _Casetyp,string memory _image,string memory _WriteUp) public {
Pgno +=1; //page no increament
MPetition[Pgno]= Petition(_Prathy,_Vaadi,_Tittle,_Casetyp,_image,_WriteUp); //pushing inputs to the structure
}
}
pragma solidity ^0.5.0;
contract CrtPolice {
address owner;
string password; //creating a major password
modifier onlyMe{ //modifier named as only me
require(msg.sender == owner);
_;
}
constructor() public {
owner=msg.sender; //declaring ower as message sender
}
uint PSNo=0 ; //each station adding it will increase
struct PoSt{
string name;
address StatAddr;
string Password;
}
mapping(uint=>PoSt) policemap;
function NewPoSt(string memory _name,address _StatAddr,string memory _Password) public onlyMe{
PSNo +=1;
policemap[PSNo] = PoSt(_name,_StatAddr,_Password);
}
}
pragma solidity ^0.5.0;
contract MasterPass { //hey
address owner;
string password; //creating a major password
modifier onlyMe{ //modifier named as only me
require(msg.sender == owner);
_;
}
constructor() public {
owner=msg.sender; //declaring ower as message sender
}
function set(string memory _password) public onlyMe { //password changing function that only done my me
password = _password;
}
}
pragma solidity ^0.5.0;
contract MyContra {
string value;
constructor() public{
value = "Hai";
}
function set(string memory _value) public {
value =_value;
}
function get() public view returns(string memory) {
return value;
}
}
pragma solidity ^0.5.0;
contract c {
address public hai;
constructor() public {
hai = msg.sender;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment