Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.