#46826 [SC-Medium] transferFeeWei + Transfers.TRANSFER_GAS_ALLOWANCE` when `CoreVault::transferToCoreVault()` is called.
Description
Summary:
// set the active request
_agent.activeTransferToCoreVault = redemptionRequestId;
// pay the transfer fee and return overpaid transfer fee when the difference is larger than gas use
// (all transfers are guarded by nonReentrant in the facet)
if (msg.value > transferFeeWei + Transfers.TRANSFER_GAS_ALLOWANCE) {
Transfers.transferNAT(state.nativeAddress, transferFeeWei);
Transfers.transferNATAllowFailure(payable(msg.sender), msg.value - transferFeeWei);
} else {
Transfers.transferNAT(state.nativeAddress, msg.value);
}
// send event
uint256 transferredUBA = Conversion.convertAmgToUBA(transferredAMG);
emit ICoreVault.TransferToCoreVaultStarted(agentVault, redemptionRequestId, transferredUBA);
}Current code's issue:
Correct implementation:
Impacts:
Impacts in scope:
Proof of Concept
Proof of Concept (PoC):
Recommended Fix:
Previous#46771 [SC-Insight] Incorrect Collateral Ratio Check Due to Rounding ErrorNext#46838 [SC-Low] Agent Destruction Can Be Blocked by Malicious Collateral Pool Entries
Was this helpful?