<!-- canonical: https://0xsimao.com/findings/glacier-transfer-shares-convert-twice -->

# Implement _transferShares() to prevent having to convert shares/wAVAX twice in glAVAX

Low/Info · Three Sigma · Liquid staking · 12th July, 2023

Finding 3S-GLACIER-N03 of the Glacier security review.

- Protocol: https://www.glacier.io/
- Report: /reports/glacier
- Source: https://cdn.sanity.io/files/qoqld077/production/21bd3b6fa78c55968a6c9c7ea4fd49f34a8bd3d8.pdf

---

### Description

Sometimes the quantity of shares on hand is available instead of the corresponding wAVAX
amount. In this case, if shares are to be transferred internally, it's easier to use
_transferShares() instead of having the shares, converting to amount and calling
[_transfer()](https://github.com/JackFrostDev/glacier-contracts/blob/main/contracts/protocol/GlacialAVAX/glAVAX.sol#L701-L708), which converts back to shares.

### Recommendation

For example, in cancel(), the shares are available from request.shares, are converted to
wAVAX amount and then back to shares again in _transfer().

### Status

Currently being reviewed by the team.

---

Related findings:

- [`GlobalVariables::oftOrCollateralReceiveFromOtherChains()` always charges twice the collateral on `COLLATERAL_TRANSFER`, which is not needed](https://0xsimao.com/findings/autonomint-collateral-charges-transfer-needed): Autonomint
