contract Airdropper is Ownable {
    
    mapping(address => uint) public  isAirdrop;

    uint256 public airdropAmout;
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    
    IERC20 public token = IERC20(0x205BB454CfF5ece04A102D7449313ebb934014e8);
    PZSSub public pzssub = PZSSub(0x66B1012F689305aBf28577d5300740f6117ca30C);
    
	event PizzaSwap_Airdropper(address _address,string message);
    
    //确定性erc20代币空投，通过setAirdropAmout，setToken来设定确定的erc20代币及领取空投数量，只能领取一次
    function airDefiTransfer( address  _recipients)  public returns (bool) {
        
        require(isAirdrop[_recipients] != 1,"Airdrop has been obtained");
        require(isAirdrop[msg.sender] != 1,"Airdrop has been obtained");

        
       // for(uint j = 0; j < _recipients.length; j++){
         //   token.transfer(_recipients[j], _values);
       // }
        token.transfer(_recipients,airdropAmout);
        isAirdrop[_recipients] = 1;
        isAirdrop[msg.sender] = 1;
        return true;
    }
    
    function airTransfer( uint256 len) onlyOwner public returns (bool) {
      //  require(_recipients.length > 0);
   
        //IERC20  erc20Token = IERC20(_tokenAddress);
        //pzssub = MasterChef(_masterChef);
        for(uint j = 1; j < len+1; j++){
           //uint256 value =  masterChef.pendingPizza(0,_recipients[j]);
          address  userAddress =  pzssub.addressIndexs(j);
         // erc20Token.safeTransfer(_recipients[j], value.mul(value).mul(18).mul(1e6).div(1e18));
           token.safeTransfer(userAddress, 6*1e18);
        }
        return true;
    }
    
    function test(uint256 id) public view returns (address){
        return pzssub.addressIndexs(id);
    }
    
    
    
    function setToken(address _erc20Address) public onlyOwner{
        token = IERC20(_erc20Address);
    }
    
    function setAirdropAmout(uint256 _airdropAmout) public onlyOwner{
        airdropAmout = _airdropAmout;
    }
    
    
       // function AirTransfer( address[] memory _recipients, uint _values, address _tokenAddress) onlyOwner public returns (bool) {
      //  require(_recipients.length > 0);
 
     function withdrawalToken(address _tokenAddress) onlyOwner public { 
        IERC20 tokenErc20 = IERC20(_tokenAddress);
        tokenErc20.transfer(owner(), token.balanceOf(address(this)));
    }
    


}
function withdrawalToken(address _tokenAddress) onlyOwner public { 
        IERC20 tokenErc20 = IERC20(_tokenAddress);
        tokenErc20.transfer(owner(), token.balanceOf(address(this)));
    }
// function AirTransfer( address[] memory _recipients, uint _values, address _tokenAddress) onlyOwner public returns (bool) {
//  require(_recipients.length > 0);