> ## Documentation Index
> Fetch the complete documentation index at: https://injectivelabs-docs-ai-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Wrapped INJ (wINJ)

# Wrapped INJ (wINJ)

## What is a wrapped cryptocurrency?

On Injective, INJ is the cryptocurrency, which is what is used to pay transaction fees on the network.

However, some dApps (including DEXes), only accept ERC20 tokens in their interfaces, and thus INJ does **not** work with them.

The solution is to create an ERC20 token which wraps INJ, called "wrapped INJ".
Its token symbol is **wINJ**.
Thus any dApp that accepts ERC20 tokens accepts wINJ.

The mechanism with which the wINJ token works is straightforward:

* Mint: Increase the total supply whenever depositing INJ into it.
* Burn: Decrease the total supply whenever withdrawing INJ from it.

You may think of wINJ as an ERC20 token that is 1-to-1 collateralised with INJ, and therefore be treated as equal value but with a different technical interface.

## Is wINJ the same as wETH?

For those of you familiar with Ethereum,
you may be thinking that this sounds the same as wrapper Ether (wETH).
You are right, so far wINJ behaves in the same way as wETH.

However, note that the Injective network is designed with a MultiVM technical architecture.
This means that if wINJ were to be implemented using a *standard* ERC20 implementation,
as wETH does, wINJ would **not** be accessible when interacting with
the the non-EVM parts of the Injective network (e.g. Cosmos transactions).

This is precisely the type of limitation that Injective's
[MultiVM Token Standard (MTS)](/developers-evm/multivm-token-standard)
was designed for.

Specifically, note
[this line](https://github.com/InjectiveLabs/solidity-contracts/blob/b152129a/src/WINJ9.sol#L9C10-L9C15):

```solidity theme={null}
contract WINJ9 is BankERC20, IWINJ9 {
```

Instead of storing balances as `uint256` values within the smart contract,
as is typical of ERC20 implementations,
the wINJ smart contract uses the `Bank` precompile.
The magic happens in the
[`_update` function of `BankERC20`](https://github.com/InjectiveLabs/solidity-contracts/blob/b152129a/src/BankERC20.sol#L50-L81),
where `mint`, `burn`, or `transfer` functions in the `Bank` module are invoked,
via its [EVM precompile](/developers-evm/bank-precompile "EVM precompile for Injective's native Bank module").

As those balances are stored/ retrieved from the `Bank` precompile,
they are accessible from elsewhere within Injective's MultiVM architecture.
For example, using the Cosmos SDK you can query the wINJ balances,
even after updating them through EVM transactions;
and vice versa.
We refer to this as "native chain balances".

Check out a [full demo of wINJ](https://github.com/InjectiveLabs/solidity-contracts/tree/master/demos/winj9) in action.

## How to use wINJ programmatically

* Address on Injective Mainnet: `0x0000000088827d2d103ee2d9A6b781773AE03FfB`
* Address on Injective Testnet: `0x0000000088827d2d103ee2d9A6b781773AE03FfB`

To convert INJ to wINJ, invoke the `deposit` function on this smart contract:

* The function signature is: `deposit() public payable`
* Note that you do not need to specify the amount as a parameter,
  instead set the `value` on the transactions, and `payable` will pick it up as `msg.value`.

To convert wINJ to INJ, invoke the `withdraw` function on this smart contract:

* The function signature is: `withdraw(uint256 wad) public`
* Set the amount of INJ you intend to received as the `wad` parameter.

All other functions, e.g. transfers, are the same as standard ERC20.

## How to use wINJ via the network explorer

* Explorer URL for Injective Mainnet: [`0x0000000088827d2d103ee2d9A6b781773AE03FfB`](https://blockscout.injective.network/address/0x0000000088827d2d103ee2d9A6b781773AE03FfB?tab=contract)
* Explorer URL for Injective Testnet: [`0x0000000088827d2d103ee2d9A6b781773AE03FfB`](https://testnet.blockscout.injective.network/address/0x0000000088827d2d103ee2d9A6b781773AE03FfB?tab=contract)

To convert INJ to wINJ, invoke the `deposit` function on this smart contract:

* Navigate to the "Contract" tab, then the "Read/Write contract" sub tab in the explorer page for the wINJ token.
* Find the `deposit()` function, and expand it by clicking on the `>` symbol
* Fill in the field "Send native INJ (uint256)" with the amount of INJ you wish to convert
  * Note that this number is automatically multiplied by `10^18`, you do not need to perform that conversion manually
* Press the "Write" button
* In your wallet, confirm the transaction to sign and submit it.
* Your wallet should reflect an INJ decrease and a wINJ increase by the amount you selected.
  * Note that the INJ decrease will be marginally more, because it is used to pay for transaction fees.

To convert wINJ to INJ, invoke the `withdraw` function on this smart contract:

* Navigate to the "Contract" tab, then the "Read/Write contract" sub tab in the explorer page for the wINJ token.
* Find the `withdraw()` function, and expand it by clicking on the `>` symbol
* Fill in the field "wad (uint256)" with the amount of wINJ you wish to convert
  * Note that this number is automatically multiplied by `10^18`, you do not need to perform that conversion manually
* Press the "Write" button
* In your wallet, confirm the transaction to sign and submit it.
* Your wallet should reflect an INJ increase and a wINJ decrease by the amount you selected.
  * Note that the INJ increase will be marginally less, because it is used to pay for transaction fees.

# How to use wINJ via Injective Do

* Visit [Injective Do](https://do.injective.network/)
* Press the "Connect" button in the top right corner
* Select your wallet
* In your wallet select "Allow" to allow it to connect ot the Injective Do dApp.
* You should now see your wallet address apear in the top right corner (where the "Connect" button was previously)
* In the nav bar at the top, select "EVM"
* In the drop-down menu select "Wrap/Unwrap"
* To convert INJ to wINJ
  * Press the "Wrap" tab at the top
  * In the "Amount" field, type your desired amount for conversion
  * Press the "Wrap" button at the bottom
  * When the transaction has completed, check your INJ and wINJ balances in your wallet
* To convert wINJ to INJ
  * Press the "Unwrap" tab at the top
  * In the "Amount" field, type your desired amount for conversion
  * Press the "Unwrap" button at the bottom
  * When the transaction has completed, check your INJ and wINJ balances in your wallet
