Skip to content

Commit 95ef165

Browse files
committed
docs: update readme
1 parent bf63eaf commit 95ef165

File tree

3 files changed

+43
-38
lines changed

3 files changed

+43
-38
lines changed

README.md

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,71 @@
1-
## Foundry
1+
## Trusted Hint Registry
22

3-
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
3+
This repository contains a smart contract for a registry of trusted hints used in decentralized ecosystems based on
4+
ERC-7506. It provides a standardized on-chain metadata management system aiding in verification of on- and off-chain
5+
data, like Verifiable Credentials.
46

5-
Foundry consists of:
7+
### Key Decisions
68

7-
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8-
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9-
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10-
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
11-
12-
## Documentation
13-
14-
https://book.getfoundry.sh/
9+
- Upgradable smart contract using ERC1967 to enable future feature additions and bug fixes.
10+
- General purpose, access-controlled data structure usable by any address for hints.
11+
- Development, testing, and deployment is done via the Foundry toolset.
12+
- The deployments and ABI are provided via an NPM package from this repository.
1513

1614
## Usage
1715

1816
### Build
1917

2018
```shell
21-
$ forge build
19+
forge build
2220
```
2321

2422
### Test
2523

2624
```shell
27-
$ forge test
25+
forge test
2826
```
2927

30-
### Format
28+
### Deploy
3129

3230
```shell
33-
$ forge fmt
31+
forge script DeployProxy --rpc-url <your_rpc_url> --private-key <your_private_key> --etherscan-api-key <your_etherscan_key> --verify --optimize --broadcast
3432
```
33+
## Usage in other projects
3534

36-
### Gas Snapshots
35+
### Install
3736

3837
```shell
39-
$ forge snapshot
38+
npm i @spherity/trusted-hint-registry
4039
```
4140

42-
### Anvil
43-
44-
```shell
45-
$ anvil
46-
```
41+
### Import
4742

48-
### Deploy
43+
This package provides separate build for CommonJS and ES modules. You can import it in your project like this:
4944

50-
```shell
51-
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
45+
```typescript
46+
import { TRUSTED_HINT_REGISTRY_ABI, deployments } from "@spherity/trusted-hint-registry"
5247
```
5348

54-
### Cast
55-
56-
```shell
57-
$ cast <subcommand>
58-
```
59-
60-
### Help
61-
62-
```shell
63-
$ forge --help
64-
$ anvil --help
65-
$ cast --help
66-
```
49+
In combination with, e.g., [viem](https://viem.sh/), you can use it like this:
50+
51+
```typescript
52+
import { TRUSTED_HINT_REGISTRY_ABI, deployments } from "@spherity/trusted-hint-registry";
53+
import { getContract } from 'viem'
54+
55+
const publicClient = createPublicClient({
56+
chain: sepolia,
57+
transport: http(),
58+
})
59+
60+
const sepoliaDeployment = deployments.find(d => d.chainId === 11155111 && d.type === "proxy")
61+
const contract = getContract({
62+
address: sepoliaDeployment.registry,
63+
abi: TRUSTED_HINT_REGISTRY_ABI,
64+
publicClient,
65+
})
66+
67+
const namespace = "0x..."
68+
const list = "0x..."
69+
const key = "0x..."
70+
const hint = await contract.read.getHint(namespace, list, key)
71+
)
-8.6 KB
Binary file not shown.

trusted-hint-registry-1.0.0.tgz

-8.59 KB
Binary file not shown.

0 commit comments

Comments
 (0)