Skip to content

use checked arithmetic in hyllar token transfers#2016

Open
Sertug17 wants to merge 1 commit into
hyli-org:mainfrom
Sertug17:fix/hyllar-checked-arithmetic
Open

use checked arithmetic in hyllar token transfers#2016
Sertug17 wants to merge 1 commit into
hyli-org:mainfrom
Sertug17:fix/hyllar-checked-arithmetic

Conversation

@Sertug17

Copy link
Copy Markdown

Replaces raw -= and += with checked_sub and checked_add in the hyllar ERC-20 contract. Also fixes unchecked allowance subtraction in transfer_from. Closes #2015

replace raw -= and += with checked_sub and checked_add in transfer
and transfer_from to prevent silent overflow/underflow wrapping.
also fix the same issue in the allowance deduction.

defense-in-depth: the balance checks already prevent underflow but
checked arithmetic ensures no silent wrapping if the guards ever
get out of sync with the actual mutations.
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.

unchecked arithmetic in hyllar token transfer and transfer_from

1 participant