all files / contracts/ KeyProtocolVariables.sol

100% Statements 35/35
92.86% Branches 65/70
100% Functions 17/17
100% Lines 59/59
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164                                                                                      138×   138× 138× 138× 138× 138×   138× 138× 138× 138× 138×                                                                                                                        
//SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
 
import "./interfaces/IKeyProtocolVariables.sol";
 
contract KeyProtocolVariables is IKeyProtocolVariables {
    address public dao;
 
    bool public preLaunch = true;
 
    //Commisions
    uint256 public xTokenMintFee = 300; // 3%
    uint256 public cTokenSellFee = 1000; // 10%
    uint256 public payRentFee = 150; // 1.5%
 
    uint256 public validatorCommission = 25; // 0.25%
    uint256 public maxValidatorFee = 1000;
 
    uint256 public sellXTokenSlippage = 300; //3%
    uint256 public buyXTokenSlippage = 300; //3%
 
    uint256 public hedgeFundAllocation = 1500; //15%
    uint8 public securityDepositMonths = 12; // 12 months
 
    uint256 public landXOperationsPercentage = 3000;
    uint256 public landXChoicePercentage = 500;
    uint256 public lndxHoldersPercentage = 6500;
 
    // Wallets
    address public hedgeFundWallet;
    address public landxOperationalWallet;
    address public landxChoiceWallet;
    address public xTokensSecurityWallet;
    address public validatorCommisionWallet;
 
    constructor(
        address _dao,
        address _hedgeFundWallet,
        address _landxOperationalWallet,
        address _landxChoiceWallet,
        address _xTokensSecurityWallet,
        address _validatorCommisionWallet
    ) {
        dao = _dao;
 
        Erequire(_hedgeFundWallet != address(0), "zero address is not allowed");
        Erequire(_landxOperationalWallet != address(0), "zero address is not allowed");
        Erequire(_landxChoiceWallet != address(0), "zero address is not allowed");
        Erequire(_xTokensSecurityWallet != address(0), "zero address is not allowed");
        Erequire(_validatorCommisionWallet != address(0), "zero address is not allowed");
 
        hedgeFundWallet = _hedgeFundWallet;
        landxOperationalWallet = _landxOperationalWallet;
        landxChoiceWallet = _landxChoiceWallet;
        xTokensSecurityWallet = _xTokensSecurityWallet;
        validatorCommisionWallet = _validatorCommisionWallet;
    }
 
    function updateXTokenMintFee(uint256 _fee) public {
        require(msg.sender == dao, "only dao can change value");
        require(_fee < 10000, "value can't be above 100%");
        xTokenMintFee = _fee;
    }
 
    function updateCTokenSellFee(uint256 _fee) public {
        require(msg.sender == dao, "only dao can change value");
        require(_fee < 10000, "value can't be above 100%");
        cTokenSellFee = _fee;
    }
 
    function updateValidatorCommission(uint256 _fee) public {
        require(msg.sender == dao, "only dao can change value");
        require(_fee < 10000, "value can't be above 100%");
        validatorCommission = _fee;
    }
 
     function updateMaxValidatorFee(uint256 _fee) public {
        require(msg.sender == dao, "only dao can change value");
        require(_fee < 10000, "value can't be above 100%");
        maxValidatorFee = _fee;
    }
 
    function updateSellXTokenSlippage(uint256 _slippage) public {
        require(msg.sender == dao, "only dao can change value");
        require(_slippage < 10000, "value can't be above 100%");
        sellXTokenSlippage = _slippage;
    }
 
    function updateBuyXTokenSlippage(uint256 _slippage) public {
        require(msg.sender == dao, "only dao can change value");
        require(_slippage < 10000, "value can't be above 100%");
        buyXTokenSlippage = _slippage;
    }
 
    function updatePayRentFee(uint256 _fee) public {
        require(msg.sender == dao, "only dao can change value");
        require(_fee < 10000, "value can't be above 100%");
        payRentFee = _fee;
    }
 
    function updateHedgeFundAllocation(uint256 _allocation) public {
        require(msg.sender == dao, "only dao can change value");
        require(_allocation < 10000, "value can't be above 100%");
        hedgeFundAllocation = _allocation;
    }
 
    function updateSecurityDepositMonths(uint8 _months) public {
        require(msg.sender == dao, "only dao can change value");
        securityDepositMonths = _months;
    }
 
    function updateFeeDistributionPercentage(
        uint256 _lndxHoldersPercentage,
        uint256 _landxOperationPercentage
    ) public {
        require(msg.sender == dao, "only dao can change value");
        require(
            (_lndxHoldersPercentage + _landxOperationPercentage) < 10000,
            "inconsistent values"
        );
        lndxHoldersPercentage = _lndxHoldersPercentage;
        landXOperationsPercentage = _landxOperationPercentage;
        landXChoicePercentage =
            10000 -
            lndxHoldersPercentage -
            landXOperationsPercentage;
    }
 
    function updateHedgeFundWallet(address _wallet) public {
        require(msg.sender == dao, "only dao can change value");
        require(_wallet != address(0), "zero address is not allowed");
        hedgeFundWallet = _wallet;
    }
 
    function updateLandxOperationalWallet(address _wallet) public {
        require(msg.sender == dao, "only dao can change value");
        require(_wallet != address(0), "zero address is not allowed");
        landxOperationalWallet = _wallet;
    }
 
    function updateLandxChoiceWallet(address _wallet) public {
        require(msg.sender == dao, "only dao can change value");
        require(_wallet != address(0), "zero address is not allowed");
        landxChoiceWallet = _wallet;
    }
 
    function updateXTokensSecurityWallet(address _wallet) public {
        require(msg.sender == dao, "only dao can change value");
        require(_wallet != address(0), "zero address is not allowed");
        xTokensSecurityWallet = _wallet;
    }
 
    function updateValidatorCommisionWallet(address _wallet) public {
        require(msg.sender == dao, "only dao can change value");
        require(_wallet != address(0), "zero address is not allowed");
        validatorCommisionWallet = _wallet;
    }
 
    function launch() public {
        require(msg.sender == dao, "only dao can change value");
        preLaunch = false;
    }
}