Skip to content

Commit

Permalink
fix: uncomment flash_loan logic
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Dec 13, 2024
1 parent 5c97ace commit bfd609f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions contracts/src/token/erc20/extensions/flash_mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ impl IErc3156FlashLender for Erc20FlashMint {
}));
}

// let flash_fee_receiver = self.flash_fee_receiver_address.get();
// erc20._spend_allowance(receiver, contract::address(), amount + fee)?;
// if fee.is_zero() || flash_fee_receiver.is_zero() {
// erc20._burn(receiver, amount + fee)?;
// } else {
// erc20._burn(receiver, amount)?;
// erc20._transfer(receiver, flash_fee_receiver, fee)?;
// }
let flash_fee_receiver = self.flash_fee_receiver_address.get();
erc20._spend_allowance(receiver, contract::address(), amount + fee)?;
if fee.is_zero() || flash_fee_receiver.is_zero() {
erc20._burn(receiver, amount + fee)?;
} else {
erc20._burn(receiver, amount)?;
erc20._transfer(receiver, flash_fee_receiver, fee)?;
}

Ok(true)
}
Expand Down

0 comments on commit bfd609f

Please sign in to comment.