-
Notifications
You must be signed in to change notification settings - Fork 204
Usage of for loops might lead to large amounts of tokens not beeing transferable. #3
Copy link
Copy link
Open
Description
Usage of for loops might lead to large amounts of tokens not beeing transferable.
In the code bellow, if the variables tokens_to_burn or tokens_to_mint are big enough, that would lead to an Out of Gas error and prevent large token transfers.
Lines 324 to 340 in 14c1362
| // Skip burn for certain addresses to save gas | |
| if (!whitelist[from]) { | |
| uint256 tokens_to_burn = (balanceBeforeSender / unit) - | |
| (balanceOf[from] / unit); | |
| for (uint256 i = 0; i < tokens_to_burn; i++) { | |
| _burn(from); | |
| } | |
| } | |
| // Skip minting for certain addresses to save gas | |
| if (!whitelist[to]) { | |
| uint256 tokens_to_mint = (balanceOf[to] / unit) - | |
| (balanceBeforeReceiver / unit); | |
| for (uint256 i = 0; i < tokens_to_mint; i++) { | |
| _mint(to); | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels