Skip to content
Closed
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
38 changes: 38 additions & 0 deletions docs/staking/contract-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contract Integration Notes

## 1. Reward Contract

- **Address**: `0x04c74e8a11c669acfb7ee01012bbf5cf1e57a10d`

---

## 2. Interface:

### 2.1 `claimedAmount`

Query how much reward has already been claimed by a specific owner.

**Code Example:**

```ts
import {keccak256, toUtf8Bytes} from 'ethers';

// User wallet address (example)
const ADDRESS = '0xabc...';

// 1) Protocol type identifier
const protocolTypeIdentifier = keccak256(toUtf8Bytes('symbiotic'));

// 2) Digest used in contract call
// if you are an operator
const operatorAddressDigest = keccak256(
toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()) + 'operator',
);

// if you are an delegator
const ownerAddressDigest = keccak256(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// if you are an operator
const ownerAddressDigest = keccak256(
toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()) + 'operator',
);

// if you are an delegator
const ownerAddressDigest = keccak256(
toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase())
);

toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase())
);

// rewardsContract.claimedAmount(ownerAddressDigest);
```
5 changes: 5 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ module.exports = {
label: "Become an Operator",
id: "staking/become-symbiotic-fp",
},
{
type: "doc",
label: "Contract Integration",
id: "staking/contract-integration",
},
{
type: "doc",
label: "FAQs",
Expand Down