7.0.0 • Published 5 months ago

@erc725/smart-contracts v7.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@erc725/smart-contracts · npm version Coverage Status

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 as a basis.
  • ERC725Y.sol: The data part of ERC725, allows to attach any key-value data to a smart contract. Uses ERC173 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

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

contract MyContract is ERC725 {
    ...
}

And import in your contract ABI in JavaScript

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 interface IDs used by the Solidity implementations of the ERC725 smart contracts.

Interface NameInterface IDDescription
ERC725X0x7545acacGeneral executor
ERC725Y0x629aa694General key-value store
ERC1650x01ffc9a7Standard 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

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.

npm run solc

This will generate files and folders under /solc

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