contract  UtilEtherBonus {
    
    uint ethWei = 1 ether;
    //depositRate    /1000
    function getDepositRate(uint value, uint day) public view returns(uint){
        if(day == 5){
            if(value >= 1 * ethWei && value <= 3 * ethWei){
                return 8;
            }
            if(value >= 4 * ethWei && value <= 6 * ethWei){
                return 10;
            }
            if(value >= 7 * ethWei && value <= 10 * ethWei){
                return 12;
            }
        }
        return 0;
    }
    //shareLevel   
    function getShareLevel(uint value) public view returns(uint){
        if(value >=1 * ethWei && value <=3 * ethWei){
            return 1;
        }
        if(value >=4 * ethWei && value<=6 * ethWei){
            return 2;
        }
        if(value >=7 * ethWei && value <=10 * ethWei){
            return 3;
        }
    }
    //shareRate     /100
    function getShareRate(uint level,uint times) public view returns(uint){
        if(level == 1 && times == 1){ 
            
            return 50;
            
        }if(level == 2 && times == 1){
            
            return 50;
            
        }if(level == 2 && times == 2){
            
            return 20;
            
        }if(level == 2 && times == 3){
            
            return 10;
            
        }
        if(level == 3) {
            if(times == 1){
                
                return 70;
                
            }if(times == 2){
                
                return 30;
                
            }if(times == 3){
                
                return 20;
                
            }if(times >= 4){
                
                return 10;
                
            }if(times >= 5 && times <= 10){
                
                return 5;
                
            }if(times >= 11 && times <=20){
                
                return 3;
                
            }if(times >= 21){
                
                return 1;
                
            }
        } 
        return 0;
        
    }
    function compareStr(string memory _str, string memory str) public pure returns(bool) {
        if (keccak256(abi.encodePacked(_str)) == keccak256(abi.encodePacked(str))) {
            return true;
        }
        return false;
    }
}
function getShareRate(uint level,uint times) public view returns(uint){
    if(level == 1 && times == 1){ 
            
        return 50;
            
    }if(level == 2 && times == 1){
            
        return 50;
            
    }if(level == 2 && times == 2){
            
        return 20;
            
    }if(level == 2 && times == 3){
            
        return 10;
            
    }
    if(level == 3) {
        if(times == 1){
                
            return 70;
                
        }if(times == 2){
                
            return 30;
                
        }if(times == 3){
                
            return 20;
                
        }if(times >= 4){
                
            return 10;
                
        }if(times >= 5 && times <= 10){
                
            return 5;
                
        }if(times >= 11 && times <=20){
                
            return 3;
                
        }if(times >= 21){
                
            return 1;
                
        }
    } 
    return 0;
        
}

//shareRate     /100