"HasBean" Tax

Everybody who has been using the baked beans before already knows the "HasBean" tax. But one lapse that Baked Bean 2.0 had was explaining the "HasBean" tax properly.

So here is a detailed explanation of the "HasBean" tax. Below is the function that is responsible for the "HasBean" tax of Bake Beans: Reborn

The hasBeanTaxed function calculates the tax rate based on the number of days passed since the user's first investment. The tax rate decreases over time, with specific rates assigned to each of the first 10 days in a cycle. Here's a detailed explanation of how the function works:

  1. Calculate Days Passed Since First Buy:

    uint256 daysPassed = getDaysSinceFirstBuy(adr);

    The function retrieves the number of days that have passed since the user's first investment using the getDaysSinceFirstBuy function. This likely returns the number of days as an integer.

  2. Determine Last Digit:

    uint256 lastDigit = daysPassed % 10;

    It calculates the last digit of the number of days passed by taking the remainder when daysPassed is divided by 10. This results in a value between 0 and 9.

  3. Return Corresponding Tax Rate:

    if (lastDigit == 0) return 90;
    if (lastDigit == 1) return 80;
    if (lastDigit == 2) return 70;
    if (lastDigit == 3) return 60;
    if (lastDigit == 4) return 50;
    if (lastDigit == 5) return 40;
    if (lastDigit == 6) return 30;
    if (lastDigit == 7) return 20;
    if (lastDigit == 8) return 10;
    if (lastDigit == 9) return 0;

    The function returns a tax rate based on the last digit of daysPassed. The tax rate starts at 90% on the 0th day and decreases by 10% each subsequent day, reaching 0% on the 9th day. This cycle repeats every 10 days.

  4. Default Return:

    return 0;

    Although this return statement is technically redundant (as all possible values of lastDigit are covered), it acts as a fallback to ensure the function always returns a value.

If you still don't get it, here is a more simple explanation:

Day 1 – Eating Beans incurs 90% Loss (0-24 hours)

Day 2– Eating Beans incurs 80% Loss (25-48 hours)

Day 3 – Eating Beans incurs 70% Loss (49-72 hours)

Day 4 – Eating Beans incurs 60% Loss (73-96 hours)

Day 5 – Eating Beans incurs 50% Loss (97-120 hours)

Day 6– Eating Beans incurs 40% Loss (121-144 hours)

Day 7 – Eating Beans incurs 30% Loss (145-168 hours)

Day 8 – Eating Beans incurs 20% Loss (169-192 hours)

Day 9 – Eating Beans incurs 10% Loss (193-216 hours)

Day 10 – Eating Beans incurs 0% (216-240 hours)

Day 11 – Resets back to Day 1

**Day 0 means the day you deposited your ETH on Baked Beans: Reborn Contract **If you want to withdraw your earnings it is best to withdraw on the 10th day of your initial deposit. **Although the hasbeantax is 0% you will still incur the regular tax of 8%. **WARNING: Adding ETH again will not reset the timer. For example, if you deposited 0.5 ETH on Day 0 and you added 1 ETH on Day 7 the timer above will not reset.

Last updated