Created
June 25, 2019 04:50
-
-
Save 18dew/9171036b1f313be7c18e1595472f1a42 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.24; | |
contract bank_ds { | |
mapping ( address => bool ) public bankRegis; | |
mapping ( address => bool ) public owner; | |
modifier isOwner(){ | |
require(owner[msg.sender] == true); | |
_; | |
} | |
event bankadded( address a); | |
} | |
contract bank is bank_ds { | |
constructor() | |
public | |
{ | |
State.Created; | |
owner[msg.sender] = true; | |
} | |
function addOwner ( address a) | |
isOwner | |
public | |
{ | |
owner[a] = true; | |
} | |
function addBank ( address a) | |
isOwner | |
public | |
{ | |
bankRegis[a] = true; | |
emit bankadded(a); | |
} | |
} | |
contract registry_ds { | |
mapping ( string => bool ) aadharKYC; | |
bank bankRegistry; | |
address public bankRegis; | |
modifier isValidBank ( ){ | |
require(bankRegistry.bankRegis(msg.sender) == true); | |
_; | |
} | |
} | |
contract registry is registry_ds { | |
constructor(address bankR) | |
public | |
{ | |
bankRegistry = bank(bankR); | |
} | |
function set ( string no ) | |
isValidBank | |
public | |
{ | |
aadharKYC[no] = true; | |
} | |
function get ( string no ) | |
isValidBank | |
public | |
view | |
returns ( bool state ) | |
{ | |
state =aadharKYC[no]; | |
} | |
} | |
contract creator { | |
registry r1; | |
bank b1; | |
address public bankR; | |
address public regis; | |
address public owner; | |
bool public state = false; | |
modifier isOwner(){ | |
require(msg.sender == owner); | |
_; | |
} | |
modifier isFalse(){ | |
require(state == false); | |
_; | |
} | |
constructor () | |
public | |
{ | |
owner = msg.sender; | |
state = false; | |
} | |
function createBank() | |
isOwner | |
isFalse | |
public | |
{ | |
b1 = new bank(); | |
bankR = address(b1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment