From 5035ca13009e573313d9bfc981d447b519971bb4 Mon Sep 17 00:00:00 2001 From: miaorun Date: Wed, 10 Dec 2025 17:32:58 +0800 Subject: [PATCH 1/2] feat: add claimedAmount --- docs/staking/contract-integration.md | 32 ++++++++++++++++++++++++++++ sidebars.js | 5 +++++ 2 files changed, 37 insertions(+) create mode 100644 docs/staking/contract-integration.md diff --git a/docs/staking/contract-integration.md b/docs/staking/contract-integration.md new file mode 100644 index 00000000..00252b03 --- /dev/null +++ b/docs/staking/contract-integration.md @@ -0,0 +1,32 @@ +# Contract Integration Notes + +## 1. Contract + +- **Address**: `0x04c74e8a11c669acfb7ee01012bbf5cf1e57a10d` + +--- + +## 2. Function: + +### 2.1 `claimedAmount` + +Query how much reward has already been claimed by a specific owner. + +**Conceptual signature:** + +```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 +const ownerAddressDigest = keccak256( + toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()), +); + +// rewardsContract.claimedAmount(ownerAddressDigest); +``` diff --git a/sidebars.js b/sidebars.js index 19ef4de9..fa0bc544 100644 --- a/sidebars.js +++ b/sidebars.js @@ -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", From a308be9fcfc7665aa9424b22417cebd37ea6f313 Mon Sep 17 00:00:00 2001 From: miaorun Date: Thu, 25 Dec 2025 20:39:17 +0800 Subject: [PATCH 2/2] chore: update claimedAmount content --- docs/staking/contract-integration.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/staking/contract-integration.md b/docs/staking/contract-integration.md index 00252b03..236979d0 100644 --- a/docs/staking/contract-integration.md +++ b/docs/staking/contract-integration.md @@ -1,18 +1,18 @@ # Contract Integration Notes -## 1. Contract +## 1. Reward Contract - **Address**: `0x04c74e8a11c669acfb7ee01012bbf5cf1e57a10d` --- -## 2. Function: +## 2. Interface: ### 2.1 `claimedAmount` Query how much reward has already been claimed by a specific owner. -**Conceptual signature:** +**Code Example:** ```ts import {keccak256, toUtf8Bytes} from 'ethers'; @@ -24,8 +24,14 @@ const ADDRESS = '0xabc...'; 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( - toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()), + toUtf8Bytes(protocolTypeIdentifier + ADDRESS.toLowerCase()) ); // rewardsContract.claimedAmount(ownerAddressDigest);