# Repo

## contract Repo

is [AragonApp](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md)

Source: [contracts/apm/Repo.sol](https://github.com/aragon/aragonOS/blob/v4.4.0/contracts/apm/Repo.sol)

## Index

* [NewVersion](#newversion)
* [getBySemanticVersion](#getbysemanticversion)
* [getByVersionId](#getbyversionid)
* [getLatest](#getlatest)
* [getLatestForContractAddress](#getlatestforcontractaddress)
* [getVersionsCount](#getversionscount)
* [initialize](#initialize)
* [isValidBump](#isvalidbump)
* [newVersion](#newversion-1)
* [semanticVersionHash](#semanticversionhash)

## Reference

### Events

#### **NewVersion** <a href="#newversion" id="newversion"></a>

` event`` `` `**`NewVersion`**`(uint256 versionId, uint16[] semanticVersion)`

Parameters:

* `versionId` - uint256
* `semanticVersion` - uint16\[]

### Functions

#### **getBySemanticVersion** <a href="#getbysemanticversion" id="getbysemanticversion"></a>

` function`` `` `**`getBySemanticVersion`**`(uint16[] _semanticVersion) public view returns (uint16[], address, bytes)ù`

Parameters:

* `_semanticVersion` - uint16\[]

Returns:

* uint16\[]
* address
* bytes

#### **getByVersionId** <a href="#getbyversionid" id="getbyversionid"></a>

` function`` `` `**`getByVersionId`**`(uint _versionId) public view returns (uint16[], address, bytes)`

***

Parameters:

* `_versionId` - uint

Returns:

* uint16\[]
* address
* bytes

#### **getLatest** <a href="#getlatest" id="getlatest"></a>

` function`` `` `**`getLatest`**`() public view returns (uint16[], address, bytes)`

***

Returns:

* uint16\[]
* address
* bytes

#### **getLatestForContractAddress** <a href="#getlatestforcontractaddress" id="getlatestforcontractaddress"></a>

` function`` `` `**`getLatestForContractAddress`**`(address _contractAddress) public view returns (uint16[], address, bytes)`

***

Parameters:

* `_contractAddress` - address

Returns:

* uint16\[]
* address
* bytes

#### **getVersionsCount** <a href="#getversionscount" id="getversionscount"></a>

` function`` `` `**`getVersionsCount`**`() public view returns (uint256)`

***

Returns:

* uint256

#### **initialize** <a href="#initialize" id="initialize"></a>

` function`` `` `**`initialize`**`() public`

***

Initialize can only be called once. It saves the block number in which it was initialized., Initialize this Repo.

Modifiers:

* [onlyInit](/developers/tools/aragonos/smart-contract-references/common/initializable.md#getinitializationblock)

#### **isValidBump** <a href="#isvalidbump" id="isvalidbump"></a>

` function`` `` `**`isValidBump`**`(uint16[] _oldVersion, uint16[] _newVersion) public pure returns (bool)`

***

Parameters:

* `_oldVersion` - uint16\[]
* `_newVersion` - uint16\[]

Returns:

* bool

#### **newVersion** <a href="#newversion" id="newversion"></a>

` function`` `` `**`newVersion`**`(uint16[] _newSemanticVersion, address _contractAddress, bytes _contentURI) public`

***

Create new version with contract \`\_contractAddress\` and content \`@fromHex(\_contentURI)\`.

Modifiers:

* [auth](/developers/tools/aragonos/smart-contract-references/apps/aragonapp.md#authp)

Parameters:

* `_newSemanticVersion` - Semantic version for new repo version
* `_contractAddress` - address for smart contract logic for version (if set to 0, it uses last versions' contractAddress)
* `_contentURI` - External URI for fetching new version's content

#### **semanticVersionHash** <a href="#semanticversionhash" id="semanticversionhash"></a>

` function`` `` `**`semanticVersionHash`**`(uint16[] version) internal pure returns (bytes32)`

***

Parameters:

* `version` - uint16\[]

Returns:

* bytes32


---

# 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://legacy-docs.aragon.org/developers/tools/aragonos/smart-contract-references/apm/repo.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.
