# @erc725/smart-contracts

> ERC725 contract implementations

Latest version **8.0.1** (published 2025-04-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @erc725/smart-contracts
pnpm add @erc725/smart-contracts
yarn add @erc725/smart-contracts
bun add @erc725/smart-contracts
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2025-04-09 |
| First published | 2021-11-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 330.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 131 |
| Author | Fabian Vogelsteller |
| Maintainers | frozeman, rryter |

## Links

- npm: https://www.npmjs.com/package/@erc725/smart-contracts
- Repository: https://github.com/ERC725Alliance/ERC725
- Homepage: https://erc725alliance.org
- Issues: https://github.com/ERC725Alliance/ERC725/issues
- npm.io page: https://npm.io/package/@erc725/smart-contracts

## Dependencies (3)

- [solidity-bytes-utils](https://npm.io/package/solidity-bytes-utils.md) ~0.8.3
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) ^4.9.6
- [@openzeppelin/contracts-upgradeable](https://npm.io/package/@openzeppelin/contracts-upgradeable.md) ^4.9.6

## Recent versions

- 8.0.1 (latest) — 2025-04-09
- 8.0.0 — 2024-10-11
- 7.0.0 — 2023-11-27
- 6.0.0 — 2023-10-10
- 5.2.0 — 2023-08-28
- 5.1.0 — 2023-06-21
- 5.0.0 — 2023-04-26
- 4.2.0 — 2023-03-15
- 4.1.1 — 2023-01-18
- 4.1.0 — 2022-12-09
- 4.0.0 — 2022-11-01
- 3.2.0 — 2022-09-02
- 3.1.2 — 2022-07-15
- 3.1.1 — 2022-06-07
- 3.1.0 — 2022-06-01
- … 17 more at https://npm.io/package/@erc725/smart-contracts/versions

## README

# @erc725/smart-contracts &middot; [![npm version](https://img.shields.io/npm/v/@erc725/smart-contracts.svg?style=flat)](https://www.npmjs.com/package/@erc725/smart-contracts) [![Coverage Status](https://coveralls.io/repos/github/ERC725Alliance/ERC725/badge.svg?branch=develop)](https://coveralls.io/github/ERC725Alliance/ERC725?branch=develop)

**This package is currently in BETA, use with caution!**

This package contains an implementation of ERC725 to make it as easy as possible to get started.\
If you see ways to improve this implementation, you are welcome to create an issue or a pull request.

The package has the following contracts:

- `ERC725X.sol`: The execute part of ERC725, allows to execute any other smart contract. Uses [ERC173](https://eips.ethereum.org/EIPS/eip-173) as a basis.
- `ERC725Y.sol`: The data part of ERC725, allows to attach any key-value data to a smart contract. Uses [ERC173](https://eips.ethereum.org/EIPS/eip-173) as a basis.
- `ERC725.sol`: Combines both implementations: `ERC725X.sol` and `ERC725Y.sol`.

## Usage

To use in your project install via npm

```
npm install @erc725/smart-contracts
```

And import in your contracts in solidity

```solidity
import "@erc725/smart-contracts/contracts/ERC725.sol";

contract MyContract is ERC725 {
    ...
}
```

And import in your contract ABI in JavaScript

```js
import ERC725 from "@erc725/smart-contracts/artifacts/ERC725.json";

const myContract = new web3.eth.Contract(ERC725.abi, "0xsomeaddress...");
```

## Development

Setup:

```
npm install
```

Run tests:

```
npm test
```

Run linter:

```
npm run lint
```

## Technical References

### Interface IDs

The table below contains a list of [ERC165](https://eips.ethereum.org/EIPS/eip-165) interface IDs used by the [Solidity implementations of the ERC725 smart contracts](./contracts/).

| Interface Name                                                         | Interface ID | Description                                |
| :--------------------------------------------------------------------- | :----------- | :----------------------------------------- |
| ERC725X                                                                | `0x7545acac` | General executor                           |
| ERC725Y                                                                | `0x629aa694` | General key-value store                    |
| [ERC165](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md) | `0x01ffc9a7` | Standard Interface Detection for Contracts |

### Solc Contract details

> **Notice:** you need the `solc` compiler installed locally to use this command. [Installation instructions can be found in the solidity documentation](https://docs.soliditylang.org/en/v0.8.9/installing-solidity.html)

The repository offers a shell utility tool that generate details about each contracts (function selectors, storage layout, evm opcodes...). You can obtain them via the following command.

```bash
npm run solc
```

This will generate files and folders under `/solc`

```
solc
 |- bytecode/
 |- evm/
 |- metadata/
 |- opcodes/
 |- selectors/
 |- storage-layout/
 |- gas-costs.md

```

---
_Source: https://npm.io/package/@erc725/smart-contracts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
