Skip to content

Commit 1420e26

Browse files
authored
Add staking contract integration doc (#334)
Add staking rewards contract address of Symbiotic FP and sample code for interface integration
1 parent 0e22c8b commit 1420e26

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contract Integration Notes
2+
3+
## 1. Reward Contract
4+
5+
**Address**: `0x04c74e8a11c669acfb7ee01012bbf5cf1e57a10d`
6+
7+
---
8+
9+
## 2. Interface
10+
11+
### 2.1 `claimedAmount`
12+
13+
Query the reward amount already claimed by a specific owner.
14+
15+
**Code Example:**
16+
17+
```ts
18+
import {keccak256, toUtf8Bytes} from 'ethers';
19+
20+
// User wallet address (example)
21+
const ADDRESS = '0xabc...';
22+
23+
// 1) Protocol type identifier
24+
const protocolTypeIdentifier = keccak256(toUtf8Bytes('symbiotic'));
25+
26+
// 2) Digest used in contract call
27+
// For Operators
28+
const operatorAddressDigest = keccak256(
29+
toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()) + 'operator',
30+
);
31+
32+
// For Delegators
33+
const ownerAddressDigest = keccak256(
34+
toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase())
35+
);
36+
37+
// Contract call
38+
// rewardsContract.claimedAmount(ownerAddressDigest);
39+
```

‎sidebars.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ module.exports = {
8888
label: "Become an Operator",
8989
id: "staking/become-symbiotic-fp",
9090
},
91+
{
92+
type: "doc",
93+
label: "Contract Integration",
94+
id: "staking/contract-integration",
95+
},
9196
{
9297
type: "doc",
9398
label: "FAQs",

0 commit comments

Comments
 (0)