Skip to content
Request an audit

‹ All findings

receive() in glAVAX should only allow wAVAX

Low/InfoGlacier·Three Sigma · Liquid staking · 12th July, 20233S-GLACIER-L05

Description

The current implementation of the receive() function in glAVAX allows any smart contract to call it, leading to lost funds.

solidity
receive() external payable {
    // prevents direct sending from a user
    require(msg.sender != tx.origin);
}

Recommendation

Refactor the function to only allow transfers from wAVAX.

solidity
receive() external payable {
    require(msg.sender == addresses.wavaxAddress());
}

Status

Currently being reviewed by the team.