Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
deleted 2 characters in body; edited tags
Source Link
Rob Hitchens
  • 55.6k
  • 11
  • 92
  • 147
contract xyz { mapping(address => bool) Users; function add(address userAddress) { require(userAddress != 0x0 && !Users[userAddress]); Users[userAddress] = true; } function pass(address passAddress) returns (bool) { return Users[passAddress]; } } contract SaveData { address[] addrs; string[] hashSet; xyz asd = xyz(); function Save(address PubAddress) { require(asd.pass(PubAddress)==true); addrs.push(PubAddress); //saving public addresses } //function to save hash function saveHash(string hashStr) { hashSet.push(hashStr); } } 

I am new to solidity, i am creating a simple user reg and checking and saving it using another contract. Contract xyz is working fine, but now i want to call it into SaveData Contract and check address using pass function that if address is whitelisted then only it will save the address.

thanks in advance

contract xyz { mapping(address => bool) Users; function add(address userAddress) { require(userAddress != 0x0 && !Users[userAddress]); Users[userAddress] = true; } function pass(address passAddress) returns (bool) { return Users[passAddress]; } } contract SaveData { address[] addrs; string[] hashSet; xyz asd = xyz(); function Save(address PubAddress) { require(asd.pass(PubAddress)==true); addrs.push(PubAddress); //saving public addresses } //function to save hash function saveHash(string hashStr) { hashSet.push(hashStr); } } 

I am new to solidity, i am creating a simple user reg and checking and saving it using another contract. Contract xyz is working fine, but now i want to call it into SaveData Contract and check address using pass function that if address is whitelisted then only it will save the address.

thanks in advance

contract xyz { mapping(address => bool) Users; function add(address userAddress) { require(userAddress != 0x0 && !Users[userAddress]); Users[userAddress] = true; } function pass(address passAddress) returns (bool) { return Users[passAddress]; } } contract SaveData { address[] addrs; string[] hashSet; xyz asd = xyz(); function Save(address PubAddress) { require(asd.pass(PubAddress)==true); addrs.push(PubAddress); //saving public addresses } //function to save hash function saveHash(string hashStr) { hashSet.push(hashStr); } } 

I am new to solidity, i am creating a simple user reg and checking and saving it using another contract. Contract xyz is working fine, but now i want to call it into SaveData Contract and check address using pass function that if address is whitelisted then only it will save the address.

thanks in advance

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link

how to call one contract function into another contract

contract xyz { mapping(address => bool) Users; function add(address userAddress) { require(userAddress != 0x0 && !Users[userAddress]); Users[userAddress] = true; } function pass(address passAddress) returns (bool) { return Users[passAddress]; } } contract SaveData { address[] addrs; string[] hashSet; xyz asd = xyz(); function Save(address PubAddress) { require(asd.pass(PubAddress)==true); addrs.push(PubAddress); //saving public addresses } //function to save hash function saveHash(string hashStr) { hashSet.push(hashStr); } } 

I am new to solidity, i am creating a simple user reg and checking and saving it using another contract. Contract xyz is working fine, but now i want to call it into SaveData Contract and check address using pass function that if address is whitelisted then only it will save the address.

thanks in advance