-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
binancebinance releted integrationbinance releted integrationgood first issueGood for newcomersGood for newcomershacktoberfest
Description
Description
We are looking to extend our existing Ankr staking protocol implementation (ankr.go) to support the Binance Smart Chain (BSC) network. This enhancement will allow users to stake BNB and receive Ankr's liquid staking tokens on BSC, expanding our platform's staking capabilities.
Tasks
- Update AnkrOperation Struct
- Introduce a new field network to identify the BSC network.
- Define an AnkrNetwork enum if not already present.
- Implement NewAnkrOperation Constructor for BSC
- Modify the constructor to accept the AnkrNetwork parameter.
- Initialize Binance-specific contract addresses and ABIs.
- Implement isAnkrChainSupported Function
- Ensure that Binance is a supported network.
- Handle Binance-Specific Configurations
- Update methods like GenerateCalldata, Validate, GetSupportedAssets, GetBalance, and GetContractAddress to handle Binance-specific logic based on the network field.
- Update GenerateCalldata Method
- Modify to handle staking (NativeStake) and unstaking (NativeUnStake) for Binance.
- Use correct function signatures and parameters for Ankr's Binance staking contracts.
- Update Validate Method
- Implement validation logic specific to Binance.
- Ensure correct parameters for staking and unstaking actions.
- Implement GetSupportedAssets
- Return the addresses of BNB and Ankr's staking tokens
- Implement GetBalance
- Retrieve user balances of BNB and Ankr's Binance staking tokens.
- Interact with the appropriate contracts to fetch balances.
- Update GetProtocolConfig
- Include network-specific configurations such as RPC URLs, chain IDs, contract addresses, and ABIs.
- Ensure that GetProtocolConfig returns accurate information based on the network.
- Update GetName and GetVersion Methods
- Adjust these methods to reflect the network, if necessary.
- For example, GetName could return "Ankr Ethereum", "Ankr Polygon", or "Ankr BSC".
- Unit Tests
- Update or add unit tests in ankr_test.go to verify the correctness of your implementation across different networks.
- Test all implemented methods, including edge cases.
- Documentation
- Include comments explaining the logic in your code.
- Update any relevant documentation or READMEs to include information about Ankr on Binance.
- Update registry.go
- In registry.go, update the setupBinanceProtocols method to register the Ankr protocol for Binance.
Resources
Ankr Staking Documentation
Ankr Contracts on GitHub
Ankr Ethereum Implementation Reference
Contribution Instructions
- Fork the Repository: Fork our GitHub repository to your account.
- Create a Branch: Create a new branch for your protocol implementation. For example, feature/extend-ankr-binance.
- Implement the Protocol: Follow the tasks outlined in this issue. Ensure your code adheres to the Protocol interface and extends the existing ankr.go file.
- Write Tests: Include unit tests to verify the correctness of your implementation.
- Submit a Pull Request: Once completed, submit a pull request to our main branch for review.
- Add Hacktoberfest Label: Mention Hacktoberfest in your PR to be counted towards your contributions.
- Code Review: Be responsive to any feedback during the code review process. Make necessary changes as requested.
Questions?
If you have any questions or need clarifications, feel free to:
- Open a Discussion: Start a discussion in the repository to engage with maintainers and other contributors.
- Comment on the Issue: Leave a comment on this issue for specific queries.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
binancebinance releted integrationbinance releted integrationgood first issueGood for newcomersGood for newcomershacktoberfest