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/initial distrib constructor #64

Merged

Conversation

0xEniotna
Copy link
Contributor

Issue: #60

This is a first draft.

In the proposed implementation, the dev would pass an array initial_holders of tuples (initial_holder_address, amount).
The initial_recipient should be in the position 0 of the array. As initial_recipient is an initial_holder, it makes sense to add him in the array. But it implies that the sum of all amounts of the initial_holders array should remain equal to initial_supply. This is verified by line 116 assert(initial_minted_supply <= initial_supply, 'Unruggable: max supply reached');.
I'm also considering that the initial_recipient account should deposit ALL of his tokens when launch_memecoin is called.. Otherwise it is not possible to perform the "team allocation" check since the balance of initial_recipient would be greater. If initial_recipient does not deposit all of his token in launch_memecoin then I'm not performing the "max team allocation" check on him which bypasses the rule (does that make sense ?).

Didn't write the tests yet, I wanted to have feedbacks on my implementation.

Copy link

vercel bot commented Dec 15, 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 18, 2023 2:28pm

@0xEniotna
Copy link
Contributor Author

I still need to write specific tests to try tricky scenarios

contracts/src/tokens/memecoin.cairo Outdated Show resolved Hide resolved
contracts/src/tokens/memecoin.cairo Outdated Show resolved Hide resolved
@0xEniotna
Copy link
Contributor Author

Added tests, should be ready now

Copy link
Contributor

@AbdelStark AbdelStark left a comment

Choose a reason for hiding this comment

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

left some comments

contracts/src/tokens/memecoin.cairo Outdated Show resolved Hide resolved
contracts/src/tokens/memecoin.cairo Outdated Show resolved Hide resolved
@0xEniotna
Copy link
Contributor Author

I need to sync my work with the main branch and it will be ready for merging

Copy link
Contributor

@AbdelStark AbdelStark 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 f83073b into keep-starknet-strange:main Dec 18, 2023
3 of 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