Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add maximum buy percentage #51

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

WhoIsNac
Copy link
Contributor

@WhoIsNac WhoIsNac commented Dec 14, 2023

implement check maximum buy percentage #6

   fn check_max_buy_percentage(self: @ContractState, amount: u256)

Test function

test_transfer_max_percentage()

test_transfer_from_max_percentage()

We need the launch phase logic to check the max percentage only during the launch duration

Suggestion:

Add a set_max_percentage function for custom setting

implement check maximum buy percentage keep-starknet-strange#6

Main changes:

```
   fn check_max_buy_percentage(self: @ContractState, amount: u256) {
            assert(
                self.erc20.ERC20_total_supply.read()
                    * MAX_PERCENTAGE_BUY_LAUNCH.into()
                    / 100 >= amount,
                'Max buy cap reached'
            )
        }
```

Test function

```
test_transfer_max_percentage()

test_transfer_from_max_percentage()
```
Copy link

vercel bot commented Dec 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unruggable-memecoin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 15, 2023 3:24pm

@WhoIsNac WhoIsNac changed the title add maximum buy percentage feat: add maximum buy percentage Dec 14, 2023
Copy link
Collaborator

@enitrat enitrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@AbdelStark AbdelStark merged commit c808a67 into keep-starknet-strange:main Dec 18, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants