IOP _ ThunderNFT 34455 - [Smart Contract - Low] Double Token Vulnerability leads to drain funds
Description
Brief/Intro
fn _transfer(from: Identity, to: Identity, asset: AssetId, amount: u64) {
require(
to != ZERO_IDENTITY_ADDRESS &&
to != ZERO_IDENTITY_CONTRACT,
PoolErrors::IdentityMustBeNonZero
);
let from_balance = _balance_of(from, asset);
let to_balance = _balance_of(to, asset);
require(from_balance >= amount, PoolErrors::AmountHigherThanBalance);
storage.balance_of.insert((from, asset), from_balance - amount);
storage.balance_of.insert((to, asset), to_balance + amount);
log(Transfer {
from,
to,
asset,
amount,
});
}Impact
References
Proof of concept
Proof of Concept
example
fix
PreviousThunderNFT | IOPNextIOP _ ThunderNFT 34496 - [Smart Contract - High] Users cant withdraw their funds for removed assets
Last updated
Was this helpful?