# Installing the npm package

Upgrading an external collection begins by installing the packages that provide the required royalty logic and parent–child integration functions. This method is recommended for most developers because it ensures that the collection inherits the most up-to-date version of the protocol standard.

### **Step 1: Install the required packages**

Run the following commands to install OpenZeppelin’s upgradeable contracts and the Infinity Games integration standard:

```solidity
npm install @openzeppelin/contracts-upgradeable
npm install @infinity-ecosystem/asset-integration-standard
```

These packages include the **AbstractGamingStudioAsset** contract, which must be added to your collection.

### **Step 2: Import the AbstractGamingStudioAsset contract**

After installation, import the contract into your collection file:

```solidity
import '@infinity-ecosystem/asset-integration-standard/contracts/token-standard/AbstractGamingStudioAsset.sol';
```

This gives your collection access to the required royalty routing, parent–child linkage, and validation functions.

### **Step 3: Inherit the abstract contract**

Update your collection contract definition to inherit the AbstractGamingStudioAsset standard:

```solidity
contract MyCollection is
  ...
  AbstractGamingStudioAsset
```

This ensures that all required logic becomes part of your collection contract.

### **Step 4: Initialize the inherited contract**

Upgradeable collections must initialize the inherited contract during deployment. Call the initializer in your collection’s `initialize` function:

```solidity
function initialize() public initializer {
    __AbstractGamingStudioAsset_init(_uri, _assetStore);
}
```

* `_uri` should be your collection URI
* `_assetStore` must be set to the Asset Store contract address:\
  **0x165F79d307CbB9861bB5a080DA757B368CE57395**

### **Step 5: Override required methods**

Two overrides are required to complete the integration:

```solidity
function getStudioName() external view override returns (string memory) {}
```

```solidity
function supportsInterface(bytes4 interfaceId)
    public
    view
    override(AbstractGamingStudioAsset)
    returns (bool)
{
    return super.supportsInterface(interfaceId);
}
```

These overrides ensure correct protocol behavior and proper identification of the collection.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://infinity-games.gitbook.io/infinity-games-docs/smart-contract-integration/modifying-a-collection-contract/installing-the-npm-package.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
