Created
March 23, 2018 08:42
-
-
Save PillarDevelopment/06a97192f2b988b6e1970e2142ef84d3 to your computer and use it in GitHub Desktop.
Функция whitelist
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.21; | |
| import "https://github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol"; | |
| contract WhiteList is Ownable { | |
| mapping (address => bool) public investorWhiteList; | |
| mapping (address => address) public referralList; | |
| function WhiteList() { | |
| } | |
| // addded new 1 address investor | |
| function addInvestorToWhiteList(address investor) external onlyOwner { | |
| require(investor != 0x0 && !investorWhiteList[investor]); | |
| investorWhiteList[investor] = true; | |
| } | |
| // deleted 1 address in array of investors | |
| function removeInvestorFromWhiteList(address investor) external onlyOwner { | |
| require(investor != 0x0 && investorWhiteList[investor]); | |
| investorWhiteList[investor] = false; | |
| } | |
| //when new user will contribute ICO contract will automatically send bonus to referral | |
| function addReferralOf(address investor, address referral) external onlyOwner { | |
| require(investor != 0x0 && referral != 0x0 && referralList[investor] == 0x0 && investor != referral); | |
| referralList[investor] = referral; | |
| } | |
| // | |
| function isAllowed(address investor) constant external returns (bool result) { | |
| return investorWhiteList[investor]; | |
| } | |
| function getReferralOf(address investor) constant external returns (address result) { | |
| return referralList[investor]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment