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

🚀 add team allocation check #11

Closed

Conversation

0xEniotna
Copy link
Contributor

@0xEniotna 0xEniotna commented Dec 12, 2023

Enforce a maximum amount of tokens that the team can hold.

Main changes are:

// Check if the team allocation cap is reached
        fn check_team_allocation(self: @ContractState, amount: u256) {
            assert(
                self.get_max_team_allocation() >= self.balances.read(self.ownable.owner() + amount),
                'Team allocation cap reached'
            );
        }
        // Compute the maximum team allocation
        // total supply * MAX_SUPPLY_PERCENTAGE_TEAM_ALLOCATION / 100
        // returns an amount of tokens
        fn get_max_team_allocation(self: @ContractState) -> u256 {
            self.total_supply.read() * MAX_SUPPLY_PERCENTAGE_TEAM_ALLOCATION.into() / 100
        }

and the call of check_team_allocation in the transfer and transferFrom functions.

Not sure also if this is exactly what you had in mind tho. I think it's better to wait for the implementation of #4 and #6 so that we're on the same page

THE TEST FOR LAUNCH_MEMECOIN is missing. It need to full implementation for that.

Copy link

vercel bot commented Dec 12, 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 13, 2023 5:52pm

@0xEniotna
Copy link
Contributor Author

I need to sync my repo

@@ -120,6 +134,9 @@ mod UnruggableMemecoin {
}

fn transfer(ref self: ContractState, recipient: ContractAddress, amount: u256) -> bool {
if (recipient == self.ownable.owner()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really necessary? That means the team bought back their own coin 🤔 If they wanted to go around this they would just transfer to another address

@AbdelStark AbdelStark closed this Dec 18, 2023
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