feat(precompiles): add NeuronRegistrationCost precompile for burn que… #2387
+128
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new EVM precompile NeuronRegistrationCost that allows smart contracts to query the current burn cost required to register a neuron on a subnet.
Features:
getBurn(uint16 netuid)- Returns the current burn cost in RAO for neuron registrationgetMinBurn(uint16 netuid)- Returns the minimum burn cost for a subnetgetMaxBurn(uint16 netuid)- Returns the maximum burn cost for a subnetisRegistrationAllowed(uint16 netuid)- Checks if registration is currently allowed on a subnetPrecompile Address:
0x0000000000000000000000000000000000000806(index 2062)Files Added/Modified:
Related Issue(s)
Type of Change
Breaking Change
N/A - This is a new feature that adds functionality without affecting existing code.
Checklist
Screenshots (if applicable)
N/A
Additional Notes
This precompile enables smart contracts to dynamically check registration costs before attempting to register neurons, improving gas efficiency and user experience for DeFi applications built on top of Bittensor.