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

Refactor burn native tokens method #123

Merged
merged 15 commits into from
Jan 27, 2025
Merged

Refactor burn native tokens method #123

merged 15 commits into from
Jan 27, 2025

Conversation

Mike-CZ
Copy link
Collaborator

@Mike-CZ Mike-CZ commented Dec 16, 2024

No description provided.

@Mike-CZ Mike-CZ requested review from thaarok and jmpike December 16, 2024 15:29
thaarok
thaarok previously approved these changes Dec 16, 2024
@Mike-CZ Mike-CZ changed the base branch from mike/disable_initializers to main December 17, 2024 06:56
@Mike-CZ Mike-CZ dismissed thaarok’s stale review December 17, 2024 06:56

The base branch was changed.

@Mike-CZ Mike-CZ requested a review from thaarok December 17, 2024 06:56
function _burnFTM(uint256 amount) internal {
if (amount != 0) {
function _burnNativeTokens(uint256 amount) internal {
if (amount != 0 && totalSupply >= amount) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if amount > totalSupply you could also do amount = totalSupply; and then burn that amount

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

replaced with revert

payable(address(0)).transfer(amount);
emit BurntFTM(amount);
emit BurntNativeTokens(amount);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you could also use call instead of transfer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is pending in #111

@Mike-CZ Mike-CZ merged commit 05eba01 into main Jan 27, 2025
2 checks passed
@Mike-CZ Mike-CZ deleted the mike/burn_native_tokens branch January 27, 2025 09:51
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