Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staked Defi Balance Strategy Added for All Ferrum Network Staking Contracts [staked-defi-balance] #1129

Merged
merged 9 commits into from
Apr 17, 2023

Conversation

taha-abbasi
Copy link
Contributor

Release Notes

New Strategy: Staked Defi Balance

In this update, I have added a new strategy called Staked Defi Balance to the snapshot-strategies repository. This custom strategy returns the score of addresses based on their staked token balance in a specific Ferrum Network DeFi staking pool contract.

Changes

  1. New Strategy File: A new file named index.ts has been added to the src/strategies/staked-defi-balance directory. This file contains the implementation of the Staked Defi Balance strategy, including multicall functionality to fetch staking balances and score calculation logic.

  2. Examples File: A new examples.json file has been added to the src/strategies/staked-defi-balance directory. This file demonstrates how to use the new strategy with the correct parameters, such as tokenContractAddress, symbol, decimals, minStakedBalance, stakingPoolContractAddress, and methodABI.

  3. Schema File: A new schema.json file has been added to the src/strategies/staked-defi-balance directory. This file defines the JSON schema for the strategy parameters, ensuring that they follow the correct structure and data types. The schema enforces the required parameters and validates their format.

Impact

This update expands the capabilities of the snapshot-strategies repository by providing a new strategy for users to calculate scores based on staked token balances in Ferrum Network's DeFi Staking Contracts. This strategy can be helpful for governance proposals and voting mechanisms that involve staked tokens in a specific staking pool contract.

Usage

To use this strategy, include it in your Snapshot configuration and provide the necessary parameters as shown in the examples.json file. Make sure the parameters follow the structure defined in the schema.json file for proper validation.

Here is an example of parameters:

{
                "tokenContractAddress": "0xe685d3CC0be48BD59082eDe30C3b64CbFc0326e2",
                "symbol": "cFRM",
                "decimals": 18,
                "minStakedBalance": "100000000000000000000000",
                "stakingPoolContractAddress": "0xb4927895cbee88e651e0582893051b3b0f8d7db8",
                "methodABI": [
                    {
                        "inputs": [
                            {
                                "internalType": "address",
                                "name": "id",
                                "type": "address"
                            },
                            {
                                "internalType": "address",
                                "name": "staker",
                                "type": "address"
                            }
                        ],
                        "name": "stakeOf",
                        "outputs": [
                            {
                                "internalType": "uint256",
                                "name": "",
                                "type": "uint256"
                            }
                        ],
                        "stateMutability": "view",
                        "type": "function"
                    }
                ]
            }

Please make sure to update your Snapshot configuration to include the new strategy and follow the release notes for any future updates or changes.

@taha-abbasi
Copy link
Contributor Author

image

image

@ChaituVR ChaituVR changed the title Staked Defi Balance Strategy Added for All Ferrum Network Staking Contracts Staked Defi Balance Strategy Added for All Ferrum Network Staking Contracts [staked-defi-balance] Apr 14, 2023
@taha-abbasi
Copy link
Contributor Author

@ChaituVR thanks for reviewing this, looks like there's a simple merge conflict:

image

image

Let me know if this is to be actioned on my part or if it will be resolved during the merge. The merge didn't go through because of the conflict it seems.

Removing name and token declaration from strategy as they are provided in example.json per ChaituVR's suggestion.

Co-authored-by: Chaitanya <yourchaitu@gmail.com>
@ChaituVR ChaituVR merged commit d581c8e into snapshot-labs:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants