Skip to main content

Overview

The WERC20 precompile provides a standardized way to wrap native EVM tokens, allowing them to be used as ERC20-compatible tokens within smart contracts. This precompile ensures a 1:1 backing between the native token and its wrapped counterpart, enabling seamless interaction with DeFi protocols and other dApps that rely on the ERC20 standard. Precompile Address: Dynamic (assigned per wrapped token) Related Module: Token wrapping utilities

Methods

deposit

Deposits native tokens in exchange for wrapped ERC20 tokens.

withdraw

Withdraws native tokens from wrapped ERC20 tokens.

totalSupply

Returns the total supply of the wrapped token.

balanceOf

Returns the wrapped token balance for a specific account.

transfer

Transfers wrapped tokens to a specified address.

approve

Approves a spender to transfer wrapped tokens on behalf of the caller.

transferFrom

Transfers wrapped tokens from one address to another, using an allowance.

allowance

Returns the remaining amount of tokens a spender is allowed to transfer on behalf of an owner.

name

Returns the name of the wrapped token.

symbol

Returns the symbol of the wrapped token.

decimals

Returns the number of decimals used by the wrapped token.

increaseAllowance

Increases the allowance granted to a spender.

decreaseAllowance

Decreases the allowance granted to a spender.

Full Solidity Interface & ABI

WERC20 Solidity Interface
WERC20 ABI