From 96f7db13c94c7430c9241eea50163cf6f2929199 Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 00:06:47 +0530 Subject: [PATCH 1/8] [delegated-ape] new delegated ape strategy --- src/strategies/delegated-ape/README.md | 47 ++++++++ src/strategies/delegated-ape/examples.json | 20 ++++ src/strategies/delegated-ape/index.ts | 120 +++++++++++++++++++++ src/strategies/index.ts | 2 + 4 files changed, 189 insertions(+) create mode 100644 src/strategies/delegated-ape/README.md create mode 100644 src/strategies/delegated-ape/examples.json create mode 100644 src/strategies/delegated-ape/index.ts diff --git a/src/strategies/delegated-ape/README.md b/src/strategies/delegated-ape/README.md new file mode 100644 index 000000000..3b81ce7a4 --- /dev/null +++ b/src/strategies/delegated-ape/README.md @@ -0,0 +1,47 @@ +# Delegated APE Strategy + +This strategy implements delegation logic for voting on the Curtis network by calling a specific delegation contract. It calculates voting power by combining delegated votes with the voter's own ETH balance. + +## How it works + +The strategy performs the following steps: + +1. **Query delegation contract**: Calls contract `0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202` on the Curtis network +2. **Get delegators**: Uses `getDelegators(address delegate, bytes32 id)` to find all addresses that have delegated to each voter +3. **Check delegation status**: Uses `delegation(address delegator, bytes32 id)` to verify delegation status +4. **Calculate voting power**: Calls `getEthBalance` on all relevant addresses to determine total voting power +5. **Apply delegation logic**: If an address hasn't delegated to anyone (delegation returns zero address), their own balance is included + +## Parameters + +| Parameter | Description | Default | +| --------- | ----------- | ------- | +| `decimals` | Number of decimals for the token | 18 | +| `symbol` | Symbol for display purposes | APE (with delegation) | + +## Technical Details + +- **Contract Address**: `0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202` +- **Delegation ID**: `0x0000000000000000000000000000000000000000000000000000000000000001` +- **Network**: Curtis (network ID: 60808) + +The strategy uses multicall for efficient batch querying of the delegation contract and ETH balances. + +## Example Configuration + +```json +{ + "symbol": "APE (with delegation)", + "decimals": 18 +} +``` + +## Usage + +This strategy is designed for governance systems where: +- Users can delegate their voting power to other addresses +- Voting power is based on ETH balance +- Delegation is handled through a specific contract on the Curtis network +- Non-delegating addresses retain their own voting power + +The strategy ensures that delegated voting power is properly aggregated while avoiding double-counting for addresses that have delegated their votes to others. diff --git a/src/strategies/delegated-ape/examples.json b/src/strategies/delegated-ape/examples.json new file mode 100644 index 000000000..35d6afe01 --- /dev/null +++ b/src/strategies/delegated-ape/examples.json @@ -0,0 +1,20 @@ +[ + { + "name": "Delegated APE strategy", + "strategy": { + "name": "delegated-ape", + "params": { + "symbol": "APE", + "decimals": 18 + } + }, + "network": "33111", + "addresses": [ + "0x556B14CbdA79A36dC33FcD461a04A5BCb5dC2A70", + "0x5EF29cf961cf3Fc02551B9BdaDAa4418c446c5dd", + "0xa40839f84CF98Ee6F4fdB84c1bB1a448e7835EfE", + "0xE919522e686D4e998e0434488273C7FA2ce153D8" + ], + "snapshot": 18653634 + } +] diff --git a/src/strategies/delegated-ape/index.ts b/src/strategies/delegated-ape/index.ts new file mode 100644 index 000000000..3b9278872 --- /dev/null +++ b/src/strategies/delegated-ape/index.ts @@ -0,0 +1,120 @@ +import { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import { formatUnits } from '@ethersproject/units'; +import { getAddress } from '@ethersproject/address'; +import networks from '@snapshot-labs/snapshot.js/src/networks.json'; +import { Multicaller } from '../../utils'; + +export const author = 'snapshot-labs'; +export const version = '0.1.0'; + +const abi = [ + 'function delegation(address delegator, bytes32 id) view returns (address delegate)', + 'function getDelegators(address delegate, bytes32 id) view returns (address[])', + 'function getEthBalance(address account) public view returns (uint256 balance)' +]; + +const CONTRACT_ADDRESS = '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; +const DELEGATION_ID = + '0x0000000000000000000000000000000000000000000000000000000000000001'; +const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; + +export async function strategy( + space: string, + network: string, + provider: any, + addresses: string[], + options: any, + snapshot: string | number +): Promise> { + const blockTag = typeof snapshot === 'number' ? snapshot : 'latest'; + + // First multicall: Get delegations and delegators for all addresses + const delegationMulticall = new Multicaller(network, provider, abi, { + blockTag + }); + + addresses.forEach((address: string) => { + delegationMulticall.call( + `delegation.${address}`, + CONTRACT_ADDRESS, + 'delegation', + [address, DELEGATION_ID] + ); + delegationMulticall.call( + `delegators.${address}`, + CONTRACT_ADDRESS, + 'getDelegators', + [address, DELEGATION_ID] + ); + }); + + const results = await delegationMulticall.execute(); + + // Process results and collect all delegators + const allDelegators = new Set(); + + addresses.forEach((voterAddress: string) => { + const delegation = results.delegation[voterAddress]; + const delegators = results.delegators[voterAddress] || []; + + // Add delegators from getDelegators call + delegators.forEach((delegator: string) => { + allDelegators.add(delegator.toLowerCase()); + }); + + // If delegation is zero address, add the voter address itself + if (delegation === ZERO_ADDRESS) { + allDelegators.add(voterAddress.toLowerCase()); + } + }); + + // Second multicall: Get ETH balance for all delegators + const balanceMulticall = new Multicaller( + network, + provider, + [ + 'function getEthBalance(address addr) public view returns (uint256 balance)' + ], + { blockTag } + ); + + Array.from(allDelegators).forEach((delegator: string) => { + balanceMulticall.call( + delegator, + networks[network].multicall, + 'getEthBalance', + [delegator] + ); + }); + + const balanceResults: Record = + await balanceMulticall.execute(); + + // Calculate final scores + const scores: Record = {}; + + addresses.forEach((voterAddress: string) => { + const delegation = results.delegation[voterAddress]; + const delegators = results.delegators[voterAddress] || []; + + let totalVotingPower = BigNumber.from(0); + + // Add voting power from all delegators + delegators.forEach((delegator: string) => { + const balance = balanceResults[delegator.toLowerCase()] || 0; + totalVotingPower = totalVotingPower.add(BigNumber.from(balance)); + }); + + // If delegation is zero address, add voter's own balance + if (delegation === ZERO_ADDRESS) { + const voterBalance = balanceResults[voterAddress.toLowerCase()] || 0; + totalVotingPower = totalVotingPower.add(BigNumber.from(voterBalance)); + } + + scores[getAddress(voterAddress)] = parseFloat( + formatUnits(totalVotingPower, options.decimals || 18) + ); + }); + + return scores; +} diff --git a/src/strategies/index.ts b/src/strategies/index.ts index 36bf57a2a..c10c7c5d1 100644 --- a/src/strategies/index.ts +++ b/src/strategies/index.ts @@ -84,6 +84,7 @@ import * as stablexswap from './stablexswap'; import * as stakedKeep from './staked-keep'; import * as stakedDaomaker from './staked-daomaker'; import * as typhoon from './typhoon'; +import * as delegatedApe from './delegated-ape'; import * as delegation from './delegation'; import * as delegationWithCap from './delegation-with-cap'; import * as delegationWithOverrides from './delegation-with-overrides'; @@ -596,6 +597,7 @@ const strategies = { 'staked-daomaker': stakedDaomaker, 'balancer-unipool': balancerUnipool, typhoon, + 'delegated-ape': delegatedApe, delegation, 'delegation-with-cap': delegationWithCap, 'delegation-with-overrides': delegationWithOverrides, From 68a1e2483bea2e2e3412fb7f32df89f7b31f67f4 Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 00:20:54 +0530 Subject: [PATCH 2/8] update delegated ape strategy --- src/strategies/delegated-ape/README.md | 41 ++------------------------ 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/src/strategies/delegated-ape/README.md b/src/strategies/delegated-ape/README.md index 3b81ce7a4..9279b3b2e 100644 --- a/src/strategies/delegated-ape/README.md +++ b/src/strategies/delegated-ape/README.md @@ -1,47 +1,12 @@ -# Delegated APE Strategy +# Delegated APE -This strategy implements delegation logic for voting on the Curtis network by calling a specific delegation contract. It calculates voting power by combining delegated votes with the voter's own ETH balance. +This strategy calculates voting power based on gas token balance with delegation support. -## How it works - -The strategy performs the following steps: - -1. **Query delegation contract**: Calls contract `0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202` on the Curtis network -2. **Get delegators**: Uses `getDelegators(address delegate, bytes32 id)` to find all addresses that have delegated to each voter -3. **Check delegation status**: Uses `delegation(address delegator, bytes32 id)` to verify delegation status -4. **Calculate voting power**: Calls `getEthBalance` on all relevant addresses to determine total voting power -5. **Apply delegation logic**: If an address hasn't delegated to anyone (delegation returns zero address), their own balance is included +If a user has delegated their voting power to someone else, their own balance is not counted toward their voting power. ## Parameters | Parameter | Description | Default | | --------- | ----------- | ------- | | `decimals` | Number of decimals for the token | 18 | -| `symbol` | Symbol for display purposes | APE (with delegation) | - -## Technical Details - -- **Contract Address**: `0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202` -- **Delegation ID**: `0x0000000000000000000000000000000000000000000000000000000000000001` -- **Network**: Curtis (network ID: 60808) - -The strategy uses multicall for efficient batch querying of the delegation contract and ETH balances. - -## Example Configuration - -```json -{ - "symbol": "APE (with delegation)", - "decimals": 18 -} -``` - -## Usage - -This strategy is designed for governance systems where: -- Users can delegate their voting power to other addresses -- Voting power is based on ETH balance -- Delegation is handled through a specific contract on the Curtis network -- Non-delegating addresses retain their own voting power -The strategy ensures that delegated voting power is properly aggregated while avoiding double-counting for addresses that have delegated their votes to others. From c04696c8a9a89caa1f68f0a3794b5c8bd1a4b66f Mon Sep 17 00:00:00 2001 From: Chaitanya Date: Tue, 10 Jun 2025 10:51:50 +0530 Subject: [PATCH 3/8] Update src/strategies/delegated-ape/examples.json --- src/strategies/delegated-ape/examples.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/strategies/delegated-ape/examples.json b/src/strategies/delegated-ape/examples.json index 35d6afe01..74bd28fa9 100644 --- a/src/strategies/delegated-ape/examples.json +++ b/src/strategies/delegated-ape/examples.json @@ -13,7 +13,8 @@ "0x556B14CbdA79A36dC33FcD461a04A5BCb5dC2A70", "0x5EF29cf961cf3Fc02551B9BdaDAa4418c446c5dd", "0xa40839f84CF98Ee6F4fdB84c1bB1a448e7835EfE", - "0xE919522e686D4e998e0434488273C7FA2ce153D8" + "0xE919522e686D4e998e0434488273C7FA2ce153D8", + "0x56ADE40bEaa702a851bF7d9eADD150E6ca3dD449" ], "snapshot": 18653634 } From b3d0fbb104924c56e4332a6ff26ea09562c30f12 Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 11:18:39 +0530 Subject: [PATCH 4/8] update delegated ape strategy --- src/strategies/delegated-ape/README.md | 8 +++++--- src/strategies/delegated-ape/examples.json | 5 ++--- src/strategies/delegated-ape/index.ts | 10 +--------- src/strategies/delegated-ape/schema.json | 19 +++++++++++++++++++ 4 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 src/strategies/delegated-ape/schema.json diff --git a/src/strategies/delegated-ape/README.md b/src/strategies/delegated-ape/README.md index 9279b3b2e..a1d9a088d 100644 --- a/src/strategies/delegated-ape/README.md +++ b/src/strategies/delegated-ape/README.md @@ -6,7 +6,9 @@ If a user has delegated their voting power to someone else, their own balance is ## Parameters -| Parameter | Description | Default | -| --------- | ----------- | ------- | -| `decimals` | Number of decimals for the token | 18 | +| Parameter | Description | +| --------- | ----------- | +| `symbol` | Symbol for display purposes (optional) | + +Note: Decimals are hardcoded to 18. diff --git a/src/strategies/delegated-ape/examples.json b/src/strategies/delegated-ape/examples.json index 74bd28fa9..9cb9587b0 100644 --- a/src/strategies/delegated-ape/examples.json +++ b/src/strategies/delegated-ape/examples.json @@ -4,8 +4,7 @@ "strategy": { "name": "delegated-ape", "params": { - "symbol": "APE", - "decimals": 18 + "symbol": "APE" } }, "network": "33111", @@ -14,7 +13,7 @@ "0x5EF29cf961cf3Fc02551B9BdaDAa4418c446c5dd", "0xa40839f84CF98Ee6F4fdB84c1bB1a448e7835EfE", "0xE919522e686D4e998e0434488273C7FA2ce153D8", - "0x56ADE40bEaa702a851bF7d9eADD150E6ca3dD449" + "0xF6108479b97EB92E2727edD5f2707620C51EB2DF" ], "snapshot": 18653634 } diff --git a/src/strategies/delegated-ape/index.ts b/src/strategies/delegated-ape/index.ts index 3b9278872..6f4978d36 100644 --- a/src/strategies/delegated-ape/index.ts +++ b/src/strategies/delegated-ape/index.ts @@ -28,7 +28,6 @@ export async function strategy( ): Promise> { const blockTag = typeof snapshot === 'number' ? snapshot : 'latest'; - // First multicall: Get delegations and delegators for all addresses const delegationMulticall = new Multicaller(network, provider, abi, { blockTag }); @@ -50,25 +49,21 @@ export async function strategy( const results = await delegationMulticall.execute(); - // Process results and collect all delegators const allDelegators = new Set(); addresses.forEach((voterAddress: string) => { const delegation = results.delegation[voterAddress]; const delegators = results.delegators[voterAddress] || []; - // Add delegators from getDelegators call delegators.forEach((delegator: string) => { allDelegators.add(delegator.toLowerCase()); }); - // If delegation is zero address, add the voter address itself if (delegation === ZERO_ADDRESS) { allDelegators.add(voterAddress.toLowerCase()); } }); - // Second multicall: Get ETH balance for all delegators const balanceMulticall = new Multicaller( network, provider, @@ -90,7 +85,6 @@ export async function strategy( const balanceResults: Record = await balanceMulticall.execute(); - // Calculate final scores const scores: Record = {}; addresses.forEach((voterAddress: string) => { @@ -99,20 +93,18 @@ export async function strategy( let totalVotingPower = BigNumber.from(0); - // Add voting power from all delegators delegators.forEach((delegator: string) => { const balance = balanceResults[delegator.toLowerCase()] || 0; totalVotingPower = totalVotingPower.add(BigNumber.from(balance)); }); - // If delegation is zero address, add voter's own balance if (delegation === ZERO_ADDRESS) { const voterBalance = balanceResults[voterAddress.toLowerCase()] || 0; totalVotingPower = totalVotingPower.add(BigNumber.from(voterBalance)); } scores[getAddress(voterAddress)] = parseFloat( - formatUnits(totalVotingPower, options.decimals || 18) + formatUnits(totalVotingPower, 18) ); }); diff --git a/src/strategies/delegated-ape/schema.json b/src/strategies/delegated-ape/schema.json new file mode 100644 index 000000000..9c1958d21 --- /dev/null +++ b/src/strategies/delegated-ape/schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/Strategy", + "definitions": { + "Strategy": { + "title": "Strategy", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "title": "Symbol", + "examples": ["e.g. APE"], + "maxLength": 16 + } + }, + "additionalProperties": false + } + } +} From d982709f5eab0bc0518e820bb5f483334333414b Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 11:31:13 +0530 Subject: [PATCH 5/8] rename CONTRACT_ADDRESS to DELEGATION_CONTRACT_ADDRESS --- src/strategies/delegated-ape/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strategies/delegated-ape/index.ts b/src/strategies/delegated-ape/index.ts index 6f4978d36..1b41516ec 100644 --- a/src/strategies/delegated-ape/index.ts +++ b/src/strategies/delegated-ape/index.ts @@ -13,7 +13,7 @@ const abi = [ 'function getEthBalance(address account) public view returns (uint256 balance)' ]; -const CONTRACT_ADDRESS = '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; +const DELEGATION_CONTRACT_ADDRESS = '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; const DELEGATION_ID = '0x0000000000000000000000000000000000000000000000000000000000000001'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; @@ -35,13 +35,13 @@ export async function strategy( addresses.forEach((address: string) => { delegationMulticall.call( `delegation.${address}`, - CONTRACT_ADDRESS, + DELEGATION_CONTRACT_ADDRESS, 'delegation', [address, DELEGATION_ID] ); delegationMulticall.call( `delegators.${address}`, - CONTRACT_ADDRESS, + DELEGATION_CONTRACT_ADDRESS, 'getDelegators', [address, DELEGATION_ID] ); From 094ba301399255c134cea85f9e1dccb0708d532a Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 11:49:12 +0530 Subject: [PATCH 6/8] add more example addresses --- src/strategies/delegated-ape/README.md | 5 +---- src/strategies/delegated-ape/examples.json | 3 ++- src/strategies/delegated-ape/index.ts | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/strategies/delegated-ape/README.md b/src/strategies/delegated-ape/README.md index a1d9a088d..43579be15 100644 --- a/src/strategies/delegated-ape/README.md +++ b/src/strategies/delegated-ape/README.md @@ -8,7 +8,4 @@ If a user has delegated their voting power to someone else, their own balance is | Parameter | Description | | --------- | ----------- | -| `symbol` | Symbol for display purposes (optional) | - -Note: Decimals are hardcoded to 18. - +| `symbol` | Symbol to display (optional) | diff --git a/src/strategies/delegated-ape/examples.json b/src/strategies/delegated-ape/examples.json index 9cb9587b0..08c416b19 100644 --- a/src/strategies/delegated-ape/examples.json +++ b/src/strategies/delegated-ape/examples.json @@ -11,8 +11,9 @@ "addresses": [ "0x556B14CbdA79A36dC33FcD461a04A5BCb5dC2A70", "0x5EF29cf961cf3Fc02551B9BdaDAa4418c446c5dd", + "0x537f1896541d28F4c70116EEa602b1B34Da95163", "0xa40839f84CF98Ee6F4fdB84c1bB1a448e7835EfE", - "0xE919522e686D4e998e0434488273C7FA2ce153D8", + "0x220bc93D88C0aF11f1159eA89a885d5ADd3A7Cf6", "0xF6108479b97EB92E2727edD5f2707620C51EB2DF" ], "snapshot": 18653634 diff --git a/src/strategies/delegated-ape/index.ts b/src/strategies/delegated-ape/index.ts index 1b41516ec..187dd9639 100644 --- a/src/strategies/delegated-ape/index.ts +++ b/src/strategies/delegated-ape/index.ts @@ -13,7 +13,8 @@ const abi = [ 'function getEthBalance(address account) public view returns (uint256 balance)' ]; -const DELEGATION_CONTRACT_ADDRESS = '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; +const DELEGATION_CONTRACT_ADDRESS = + '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; const DELEGATION_ID = '0x0000000000000000000000000000000000000000000000000000000000000001'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; From f5f0958382374015d8330b6e595c1868cc7c4665 Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 17:19:05 +0530 Subject: [PATCH 7/8] options for delegation contract and ID --- src/strategies/delegated-ape/README.md | 18 +++++++++++++++--- src/strategies/delegated-ape/examples.json | 4 +++- src/strategies/delegated-ape/index.ts | 12 ++++-------- src/strategies/delegated-ape/schema.json | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/strategies/delegated-ape/README.md b/src/strategies/delegated-ape/README.md index 43579be15..6e0108fab 100644 --- a/src/strategies/delegated-ape/README.md +++ b/src/strategies/delegated-ape/README.md @@ -6,6 +6,18 @@ If a user has delegated their voting power to someone else, their own balance is ## Parameters -| Parameter | Description | -| --------- | ----------- | -| `symbol` | Symbol to display (optional) | +| Parameter | Description | Required | +| --------- | ----------- | -------- | +| `delegationContract` | Address of the delegation contract | Yes | +| `delegationId` | Delegation ID (bytes32) to query | Yes | +| `symbol` | Symbol to display | No | + +## Example Configuration + +```json +{ + "delegationContract": "0xDd6B74123b2aB93aD701320D3F8D1b92B4fA5202", + "delegationId": "0x0000000000000000000000000000000000000000000000000000000000000001", + "symbol": "APE" +} +``` diff --git a/src/strategies/delegated-ape/examples.json b/src/strategies/delegated-ape/examples.json index 08c416b19..4c3b95cc8 100644 --- a/src/strategies/delegated-ape/examples.json +++ b/src/strategies/delegated-ape/examples.json @@ -4,7 +4,9 @@ "strategy": { "name": "delegated-ape", "params": { - "symbol": "APE" + "symbol": "APE", + "delegationContract": "0xDd6B74123b2aB93aD701320D3F8D1b92B4fA5202", + "delegationId": "0x0000000000000000000000000000000000000000000000000000000000000001" } }, "network": "33111", diff --git a/src/strategies/delegated-ape/index.ts b/src/strategies/delegated-ape/index.ts index 187dd9639..114b78ed4 100644 --- a/src/strategies/delegated-ape/index.ts +++ b/src/strategies/delegated-ape/index.ts @@ -13,10 +13,6 @@ const abi = [ 'function getEthBalance(address account) public view returns (uint256 balance)' ]; -const DELEGATION_CONTRACT_ADDRESS = - '0xdd6b74123b2ab93ad701320d3f8d1b92b4fa5202'; -const DELEGATION_ID = - '0x0000000000000000000000000000000000000000000000000000000000000001'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; export async function strategy( @@ -36,15 +32,15 @@ export async function strategy( addresses.forEach((address: string) => { delegationMulticall.call( `delegation.${address}`, - DELEGATION_CONTRACT_ADDRESS, + options.delegationContract, 'delegation', - [address, DELEGATION_ID] + [address, options.delegationId] ); delegationMulticall.call( `delegators.${address}`, - DELEGATION_CONTRACT_ADDRESS, + options.delegationContract, 'getDelegators', - [address, DELEGATION_ID] + [address, options.delegationId] ); }); diff --git a/src/strategies/delegated-ape/schema.json b/src/strategies/delegated-ape/schema.json index 9c1958d21..83ed1b122 100644 --- a/src/strategies/delegated-ape/schema.json +++ b/src/strategies/delegated-ape/schema.json @@ -11,8 +11,25 @@ "title": "Symbol", "examples": ["e.g. APE"], "maxLength": 16 + }, + "delegationContract": { + "type": "string", + "title": "Delegation Contract Address", + "examples": ["e.g. 0xDd6B74123b2aB93aD701320D3F8D1b92B4fA5202"], + "pattern": "^0x[a-fA-F0-9]{40}$", + "minLength": 42, + "maxLength": 42 + }, + "delegationId": { + "type": "string", + "title": "Delegation ID", + "examples": ["e.g. 0x0000000000000000000000000000000000000000000000000000000000000001"], + "pattern": "^0x[a-fA-F0-9]{64}$", + "minLength": 0, + "maxLength": 100 } }, + "required": ["delegationContract", "delegationId"], "additionalProperties": false } } From 42c213e41db90e1e39697be3e65b8f86f1505916 Mon Sep 17 00:00:00 2001 From: ChaituVR Date: Tue, 10 Jun 2025 17:46:56 +0530 Subject: [PATCH 8/8] lint --- src/strategies/delegated-ape/schema.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/strategies/delegated-ape/schema.json b/src/strategies/delegated-ape/schema.json index 83ed1b122..237f69198 100644 --- a/src/strategies/delegated-ape/schema.json +++ b/src/strategies/delegated-ape/schema.json @@ -23,7 +23,9 @@ "delegationId": { "type": "string", "title": "Delegation ID", - "examples": ["e.g. 0x0000000000000000000000000000000000000000000000000000000000000001"], + "examples": [ + "e.g. 0x0000000000000000000000000000000000000000000000000000000000000001" + ], "pattern": "^0x[a-fA-F0-9]{64}$", "minLength": 0, "maxLength": 100