Created
July 2, 2019 11:28
-
-
Save 5p4r70n/5d34096003750325d4842b4ca7809ac6 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=
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.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 | |
} | |
} |
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.5.0; | |
contract CrtPolice { | |
uint PSNo=0 ; //each station adding it will increase | |
struct PoSt{ | |
string name; | |
address StatAddr; | |
string Password; | |
} | |
mapping(uint=>PoSt) | |
} |
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.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; | |
} | |
} |
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.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; | |
} | |
} |
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.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