> For the complete documentation index, see [llms.txt](https://v1.docs.blueberry.garden/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v1.docs.blueberry.garden/developer-guides/contracts/wrapper/waurapools.md).

# WAuraPools

The `WAuraPools` contract is a wrapper for leveraged liquidity provider (LP) tokens on the Blueberry Protocol. The contract allows users to mint and burn ERC-1155 tokens representing their LP positions, while also allowing them to interact with the underlying rewards of the associated pools.

### Key Features

* Inherits from OpenZeppelin's `ERC1155Upgradeable`, `ReentrancyGuardUpgradeable`, `OwnableUpgradeable`, and `EnsureApprove` contracts.
* Implements `IERC20Wrapper` and `IWAuraPools` interfaces.
* Mints and burns wrapped LP tokens (ERC-1155 tokens) while interacting with the underlying rewards.

### Functions

#### initialize

Initializes the contract with the given AURA token and Aura Pools contract addresses.

```solidity
function initialize(
    address aura_,
    address auraPools_
) external initializer;
```

#### encodeId

Encodes the given pool ID and AURA per share value into an ERC-1155 token ID.

```solidity
function encodeId(
    uint256 pid,
    uint256 auraPerShare
) public pure returns (uint256 id);
```

#### decodeId

Decodes the given ERC-1155 token ID into its pool ID and AURA per share value.

```solidity
function decodeId(
    uint256 id
) public pure returns (uint256 gid, uint256 auraPerShare);
```

#### getUnderlyingToken

Returns the underlying ERC20 token address for the given ERC-1155 token ID.

```solidity
function getUnderlyingToken(
    uint256 id
) external view override returns (address uToken);
```

#### getVault

Returns the Balancer vault associated with the given Balancer pool token.

```solidity
solidityCopy codefunction getVault(address bpt) public view returns (IBalancerVault);
```

#### getPoolTokens

Returns the tokens, balances, and last changed block for the given Balancer pool token.

```solidity
function getPoolTokens(
    address bpt
)
    external
    view
    returns (
        address[] memory tokens,
        uint256[] memory balances,
        uint256 lastChangedBlock
    );
```

#### getPool

Returns the Balancer pool address and pool ID associated with the given Balancer pool token and pool ID.

```solidity
function getPool(
    address bpt,
    uint256 pid
) external view returns (address, uint256);
```

#### getPoolInfoFromPoolId

Returns detailed information about the pool associated with the given pool ID.

```solidity
function getPoolInfoFromPoolId(
    uint256 pid
)
    public
    view
    returns (
        address lptoken,
        address token,
        address gauge,
        address crvRewards,
        address stash,
        bool shutdown
    );
```

#### pendingRewards

Returns the pending rewards for the given ERC-1155 token ID and amount.

```solidity
function pendingRewards(
    uint256 tokenId,
    uint256 amount
)
    public
    view
    override
    returns (address[] memory tokens, uint256[] memory rewards);
```

#### mint

Mints wrapped LP tokens (ERC-1155 tokens) for the given pool ID and amount.

```solidity
function mint(
    uint256 pid,
    uint256 amount
) external nonReentrant returns (uint256 id);
```

#### burn

Burns the given ERC-1155 token ID and amount to redeem the underlying LP tokens and associated rewards.

{% code overflow="wrap" %}

```solidity
function burn(
    uint256 id,
    uint256 amount
) external nonReentrant returns (address[] memory rewardTokens, uint256[] memory rewards);
```

{% endcode %}
