Darwin-Coin / darwin-token-contracts

Darwin Protocol Smart Contracts
https://darwinprotocol.io
0 stars 0 forks source link

Darwin:provideLpAndWithdrawTokens needs updates #25

Closed thesios closed 1 year ago

thesios commented 1 year ago

1) remove the unpause IPausable(address(darwin)).unpause(); // unpause darwin transfer IPausable(address(finch)).unpause(); // unpause finch transfer

2) there should not be a need to move BNB to Marketing token since marketing funds are removed as purchases are made uint256 marketing = (status.raisedAmount (MARKETING_PERCENTAGE + MARKETING_ADDITIONAL_PERCENTAGE)) / 100; marketing -= marketingWithdrawn; marketingWithdrawn += marketing; uint256 team = (status.raisedAmount TEAM_PERCENTAGE) / 100;

3) liquidity should be 45% of the gross sold amount

    uint256 lp = balance - marketing - team; // 45%

4) finch liq should be 1 BNB regardless

    uint256 finchLp = lp / 10; // 10% of lp
    if (finchLp > 1 ether) {
        finchLp = 1 ether;
    }
    lp -= finchLp;

5) any remaining darwin and flinch tokens should be sent back to deployer

SonOfMosiah commented 1 year ago

I would leave the code for 4. Just to have a case where the contract handles all potential states regardless of amount fundraised. In the case where only .5 BNB is raised, the transaction would revert.

SomeTimesIInvent commented 1 year ago

I would leave the code for 4. Just to have a case where the contract handles all potential states regardless of amount fundraised. In the case where only .5 BNB is raised, the transaction would revert.

Ammon's idea makes sense on this. While 1bnb is virtually nothing, we should plan for worse case scenario just in case.

thesios commented 1 year ago

@kingofclubstroyDev did ur changes took care of this issue as well?

I think so

kingofclubstroyDev commented 1 year ago

yeah i believe so