Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Atomic settlements (X versus Payment Settlements)"
title: "XvP atomic settlements"
description:
Enable atomic settlements between parties with X versus Payment (XvP)
Settlements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ title: "Audit logs"
description: Audit logs for the actions performed on SettleMint platform
---

import { Tabs, Tab } from "fumadocs-ui/components/tabs";
import { Callout } from "fumadocs-ui/components/callout";
import { Steps } from "fumadocs-ui/components/steps";
import { Card } from "fumadocs-ui/components/card";

The audit log keeps a detailed record of user actions across the system, helping
teams monitor activity, track changes, and stay compliant with internal and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,10 @@ Here's an example JSON body for a smart contract function like `createProfile`:

#### Field descriptions

- **`from`**: Public key of the wallet that will initiate the transaction.
Typically, this is the deployer's address. For advanced scenarios, this can be
- **`from`**: Address of the wallet that will initiate the transaction.
Typically, this is the deployer private key's address e.g. 0x03739d74f28817826936F671e9C59777cb1E7b07 which you used while deploying the smart contract. For advanced scenarios, this can be
a specific user's public address, depending on roles.
- **`gasLimit`**: Use a reasonably high value for zero-gas private networks. For
- **`gasLimit`**: Use a reasonably high value for zero-gas private networks e.g. 100,000,000,000. For
others, determine a realistic value through trial and error. You can fine-tune
this based on actual gas usage from previous transactions.
- **`gasPrice`**: Set to `0` for zero-gas networks, or specify an appropriate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: "Setup graph middleware"
description: Setup read middleware
---

import { Tabs, Tab } from "fumadocs-ui/components/tabs";
import { Callout } from "fumadocs-ui/components/callout";
import { Steps } from "fumadocs-ui/components/steps";
import { Card } from "fumadocs-ui/components/card";
Expand Down Expand Up @@ -103,6 +102,46 @@ subgraph/
└── mycontract.ts
```

For multiple smart contracts - MyContractOne and MyContractTwo, the folder
structure will look like -

```bash
subgraph/
├── subgraph.config.json
├── datasources/
│ ├── mycontractone.gql.json
│ ├── mycontractone.ts
│ ├── mycontractone.yaml
│ ├── mycontracttwo.gql.json
│ ├── mycontracttwo.ts
│ └── mycontracttwo.yaml
└── fetch/
├── mycontractone.ts
└── mycontracttwo.ts
```

You can keep all the names in small case and have one set each for each smart
contract.

Example setup for UserData smart contrat-

```bash
subgraph/
├── subgraph.config.json
├── datasources/
│ ├── userdata.gql.json
│ ├── userdata.ts
│ └── userdata.yaml
└── fetch/
└── userdata.ts
```

## Subgraph deployment process

### 1. Collect constants needed
Expand Down Expand Up @@ -151,6 +190,29 @@ folder.
}
```

For multiple smart contracts, this will look like -

```json
{
"output": "generated/scs.",
"chain": "44819",
"datasources": [
{
"name": "MyContractOne",
"address": "0x1111111111111111111111111111111111111111",
"startBlock": 0,
"module": ["mycontractone"]
},
{
"name": "MyContractTwo",
"address": "0x2222222222222222222222222222222222222222",
"startBlock": 500,
"module": ["mycontracttwo"]
}
]
}
```

### 3. Create userdata.yaml file

This is the YAML manifest file that tells the subgraph how to interact with a
Expand All @@ -173,33 +235,33 @@ contract (parameter order and types must be accurate), and align them with the
corresponding handler function names.

```yaml
- kind: ethereum/contract
name: {id}
network: {chain}
source:
address: "{address}"
abi: UserData
startBlock: {startBlock}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- UserProfile
- ProfileCreated
- ProfileUpdated
- ProfileDeleted
abis:
- name: UserData
file: "{root}/out/UserData.sol/UserData.json"
eventHandlers:
- event: ProfileCreated(indexed uint256,string,string,uint8,string,bool)
handler: handleProfileCreated
- event: ProfileUpdated(indexed uint256,string,string,uint8,string,bool)
handler: handleProfileUpdated
- event: ProfileDeleted(indexed uint256)
handler: handleProfileDeleted
file: {file}
- kind: ethereum/contract
name: { id }
network: { chain }
source:
address: "{address}"
abi: UserData
startBlock: { startBlock }
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- UserProfile
- ProfileCreated
- ProfileUpdated
- ProfileDeleted
abis:
- name: UserData
file: "{root}/out/UserData.sol/UserData.json"
eventHandlers:
- event: ProfileCreated(indexed uint256,string,string,uint8,string,bool)
handler: handleProfileCreated
- event: ProfileUpdated(indexed uint256,string,string,uint8,string,bool)
handler: handleProfileUpdated
- event: ProfileDeleted(indexed uint256)
handler: handleProfileDeleted
file: { file }
```

### 4. Create userdata.gql.json file
Expand Down