Agent documentation index: llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Skip to main content

IWNat

Interface for wrapping and unwrapping the native Flare token (FLR/SGB/C2FLR/CFLR) into the ERC-20 representation WNAT.

Sourced from IWNat.sol in @flarenetwork/flare-periphery-contracts (v0.1.41+).

The published IWNat interface only declares the four functions below. The ERC-20 surface area (balanceOf, transfer, approve, allowance, ...) is inherited via the WNat implementation contract, not the IWNat interface; if you need those methods, import IVPToken (which extends IERC20) instead. Vote-power and delegation methods (delegate, governanceVotePower, ...) come from IVPToken + IGovernanceVotePower.

Functions

deposit

Deposit native token and mint WNAT ERC-20 to the caller.

function deposit() external payable;

withdraw

Withdraw native token and burn WNAT ERC-20 from the caller.

function withdraw(uint256 _amount) external;

Parameters:

  • _amount: The amount to withdraw.

depositTo

Deposit native token from msg.sender and mint WNAT ERC-20 to _recipient.

function depositTo(address _recipient) external payable;

Parameters:

  • _recipient: The address that receives the minted WNAT.

withdrawFrom

Withdraw WNAT from _owner (subject to allowance) and send the native token to msg.sender.

function withdrawFrom(address _owner, uint256 _amount) external;

Parameters:

  • _owner: An address spending the native tokens.
  • _amount: The amount to spend.

Requirements:

  • _owner must have a balance of at least _amount.
  • The caller must have an allowance for _owner's tokens of at least _amount.
  • IVPToken — ERC-20 + vote-power view methods inherited by the WNat implementation.
  • IGovernanceVotePower — governance vote-power delegation methods.
  • IClaimSetupManager — claim executor configuration that builds on top of WNAT.