<!-- canonical: https://0xsimao.com/findings/keyring-ii-keyring-fees-send-transfer -->

# KeyringCoreV2Base::collectFees() should use Address::sendValue() instead of address.transfer()

Low/Info · Three Sigma · Zero-knowledge compliance · 10th July, 2024

Finding 3S-Keyring-L01 of the Keyring Credentials security review.

- Protocol: https://www.keyring.network/
- Report: /reports/keyring-ii
- Source: https://cdn.sanity.io/files/qoqld077/production/75b68b74f4b0dc6fbcd94892d934547d8259b57a.pdf

---

### Description

address.transfer() hardcodes 2300 gas to forward, which may not be enough if gas costs
change in the future or to is a smart contract wallet that does some logic in its
receive()/fallback() function.

### Recommendation

Use address::sendValue() from [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Address.sol#L33).

### Status

Addressed in [#ffe8b11](https://github.com/Keyring-Network/core-v2/commit/ffe8b11b3c8b1eaadb1713eb19e80872a9d1c630).

---

Related findings:

- [Use of `address.transfer` instead of the recommended `address.call{value: amount}("")`](https://0xsimao.com/findings/blast-ido-pools-transfer-recommended-call-value): Blast IDO Pools
- [triggerSendFrom() will send all the ETH in the destination chain where sendFrom() is called to the refundAddress in the LzCallParams argument](https://0xsimao.com/findings/tapioca-dao-eth-refund-params-argument): Tapioca DAO
- [UniswapLiquidityAssetManager::_validateCollectFeesArgs() validates nullifier instead of note footer](https://0xsimao.com/findings/singularity-uniswap-fees-validates-nullifier): Singularity
- [In BaseRouter, _handleSwapAction(...), users shouldn't be allowed to send funds to an allowed flasher](https://0xsimao.com/findings/fuji-finance-handle-action-shouldn-flasher): Fuji Finance
