-
Notifications
You must be signed in to change notification settings - Fork 16
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
chore: spellchecker #166
chore: spellchecker #166
Conversation
WalkthroughThis pull request introduces several changes focused on improving documentation and correcting typographical errors across various modules in the codebase. Key modifications include updates to the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (34)
.github/workflows/spellcheck.yml (3)
3-5
: Enhance workflow trigger configurationConsider specifying event types and paths to make the workflow more efficient:
on: pull_request: + types: [opened, synchronize, reopened] + paths: + - '**/*.md' + - '**/*.txt' + - '**/*.rs' + - '**/*.py' + - '**/*.js' + - '**/*.ts' + - '**/*.yaml' + - '**/*.yml'
17-28
: Enhance PR creation configurationThe PR creation step could be improved with additional metadata and better documentation:
- uses: peter-evans/create-pull-request@v7.0.5 if: github.event_name != 'pull_request' with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "chore: fix typos" title: "chore: fix typos" branch: "chore/fix-typos" delete-branch: true + labels: | + typo + automated + assignees: ${{ github.actor }} body: | This PR fixes typos in the codebase. - Please review it, and merge if everything is fine. - If there are proto changes, run `make proto-gen` and commit the changes. + ## Changes Made + This PR was automatically generated to fix spelling errors found by codespell. + + ## Review Instructions + 1. Please review the changes carefully + 2. If proto files were modified, run `make proto-gen` + 3. Verify no code logic was accidentally modified + + ## Verification + - [ ] Changes only affect comments and strings + - [ ] No code logic was modified + - [ ] Proto files are in sync (if applicable)
13-13
: Improve error handling and reportingUsing
continue-on-error: true
without proper error reporting could hide important issues.Consider:
- Adding a step to save spell check results as artifacts
- Creating a comment on the PR with the results
- Using a custom action to parse and report errors in a more structured way
precompile/modules/minitia_stdlib/sources/math64.move (1)
277-283
: LGTM! Parameter rename with documentation suggestion.The parameter rename from "precission" to "precision" improves consistency. Consider adding a brief doc comment explaining the
precision
parameter's role (e.g., number of significant digits to compare).#[test_only] /// For functions that approximate a value it's useful to test a value is close /// to the most correct value up to last digit + /// @param precision: number of significant digits to compare fun assert_approx_the_same(x: u128, y: u128, precision: u64) {
precompile/modules/initia_stdlib/doc/dispatchable_fungible_asset.md (1)
288-288
: Add missing article in documentationThe sentence should include an article before "asset". Consider:
-The recipient is guaranteed to receive asset greater than the expected amount. +The recipient is guaranteed to receive an asset greater than the expected amount.or
-The recipient is guaranteed to receive asset greater than the expected amount. +The recipient is guaranteed to receive assets greater than the expected amount.🧰 Tools
🪛 LanguageTool
[uncategorized] ~288-~288: Possible missing article found.
Context: ... The recipient is guaranteed to receive asset greater than the expected amount. Note:...(AI_HYDRA_LEO_MISSING_AN)
precompile/modules/minitia_stdlib/doc/dispatchable_fungible_asset.md (1)
288-288
: Improve grammar and clarity in the documentation.The sentence should be revised for better grammar and clarity.
-The recipient is guaranteed to receive asset greater than the expected amount. +The recipient is guaranteed to receive assets greater than or equal to the expected amount.crates/json/src/json_to_value.rs (1)
454-454
: LGTM! Consider enhancing the test case description.The comment correction accurately describes the test case. Consider adding more context about what makes the address invalid (i.e., non-hexadecimal characters 'gg').
- // invalid inner address + // invalid inner address (non-hexadecimal characters)precompile/modules/minitia_stdlib/doc/nft.md (1)
129-129
: Enhance the MutatorRef struct documentation.Consider expanding the documentation to provide more details about:
- Which fields can be mutated using this reference
- Security implications of mutation capabilities
- Best practices for handling MutatorRef
Apply this diff to improve the documentation:
-This enables mutating description and URI by higher level services. +This reference enables controlled mutation of specific NFT fields (description and URI) by higher level services. The separation of mutation capabilities helps maintain security by restricting which services can modify NFT metadata. Handle with care as it provides persistent mutation access.precompile/modules/minitia_stdlib/doc/coin.md (2)
478-478
: Enhance function documentation with parameter and return value descriptions.The function descriptions for
mint
,mint_to
, andburn
could be more comprehensive. Consider adding:
- Parameter descriptions
- Return value descriptions
- Usage examples
Example enhancement for
mint
:-Mint FAs as the owner of metadata object. +Mint fungible assets as the owner of metadata object. + +Parameters: +- mint_cap: The capability required to mint new assets +- amount: The amount of assets to mint + +Returns: +- A new fungible asset of the specified amount + +Example: +```move +let mint_cap = /* ... */; +let coins = coin::mint(&mint_cap, 100); +```Also applies to: 509-509, 542-542
Line range hint
12-24
: Revise discount calculation logic to prevent negative customer benefit.The current implementation has a critical flaw where adding a flat $20 fee after applying the discount can result in a higher final bill than without a discount, especially for small purchase amounts.
Example:
- Purchase amount: $100
- 10% discount (3-4 years loyalty): -$10
- Flat fee: +$20
- Final amount: $110 (higher than original $100)
Consider these alternatives:
- Apply the flat fee before the discount
- Scale the fee based on the purchase amount
- Remove the fee for smaller purchase amounts
Here's an example implementation of option 1:
- discounted_amount = amount - (amount * discount) - if discount > 0: - final_amount = discounted_amount + 20 - else: - final_amount = discounted_amount + base_amount = amount + (discount > 0 ? 20 : 0) + final_amount = base_amount - (base_amount * discount)precompile/modules/initia_stdlib/doc/collection.md (3)
875-876
: Fix typo in function documentation.The word "seach" should be "search" in the
nfts
function documentation.-if `start_after` is not none, seach nfts in range (start_after, ...] +if `start_after` is not none, search nfts in range (start_after, ...]
Line range hint
892-902
: Clarify table iterator direction parameter.The table iterator direction is set to
2
which is a magic number. Consider using a named constant to improve code readability and maintainability.let nfts_iter = table::iter( &collection.nfts, option::none(), start_after, - 2 + ASCENDING // or appropriate constant name );
Line range hint
242-242
: Document URI length limit rationale.Consider adding a comment explaining why 512 bytes was chosen as the maximum URI length. This helps future maintainers understand if this limit needs adjustment.
+// 512 bytes is chosen as a reasonable limit that accommodates most URIs while preventing excessive storage usage const MAX_URI_LENGTH: u64 = 512;
precompile/modules/minitia_stdlib/doc/collection.md (2)
875-876
: Improve clarity of thenfts
function documentation.The current documentation could be clearer. Consider this revision:
-if `start_after` is not none, search nfts in range (start_after, ...] +If `start_after` is provided, returns NFTs with token IDs lexicographically greater than the specified value.
Line range hint
892-897
: Consider improving thenfts
function implementation.
- The iterator direction parameter is hardcoded to
2
without explanation. Consider using a named constant to clarify its purpose.- The function silently caps the
limit
parameter. Consider either:
- Returning the actual limit used
- Throwing an error if the requested limit exceeds MAX_QUERY_LIMIT
- Documenting this behavior clearly in the function's documentation
precompile/modules/initia_stdlib/doc/primary_fungible_store.md (2)
663-663
: Fix grammatical error in documentationAdd the missing article "the" before "minimum deposit assertion api".
-Use the minimum deposit assertion api to make sure recipient will receive a minimum amount of fund. +Use the minimum deposit assertion API to make sure the recipient will receive a minimum amount of funds.🧰 Tools
🪛 LanguageTool
[uncategorized] ~663-~663: Possible missing article found.
Context: ...imum deposit assertion api to make sure recipient will receive a minimum amount of fund. ...(AI_HYDRA_LEO_MISSING_THE)
Line range hint
663-676
: Add input validation for minimum depositThe function should validate that the transfer amount is greater than or equal to the expected minimum deposit to prevent unnecessary transfers that would fail the assertion.
public entry fun transfer_assert_minimum_deposit<T: key>( sender: &signer, metadata: Object<T>, recipient: address, amount: u64, expected: u64 ) acquires DeriveRefPod, ModuleStore { + assert!(amount >= expected, 0x1); // Add error code as per your error category let sender_store = ensure_primary_store_exists(signer::address_of(sender), metadata); let recipient_store = ensure_primary_store_exists(recipient, metadata); dispatchable_fungible_asset::transfer_assert_minimum_deposit( sender, sender_store, recipient_store, amount, expected ); }
🧰 Tools
🪛 LanguageTool
[uncategorized] ~663-~663: Possible missing article found.
Context: ...imum deposit assertion api to make sure recipient will receive a minimum amount of fund. ...(AI_HYDRA_LEO_MISSING_THE)
precompile/modules/initia_stdlib/sources/fa/fungible_asset.move (1)
Line range hint
91-91
: Fix typo in error constant nameThe constant name has a typo:
ECONNOT_MANIPULATE_MODULE_ACCOUNT_STORE
should beECANNOT_MANIPULATE_MODULE_ACCOUNT_STORE
.- const ECONNOT_MANIPULATE_MODULE_ACCOUNT_STORE: u64 = 91; + const ECANNOT_MANIPULATE_MODULE_ACCOUNT_STORE: u64 = 91;precompile/modules/initia_stdlib/doc/object.md (4)
553-553
: Add documentation about the rationale for maximum nesting depth.The constant
MAXIMUM_OBJECT_NESTING
would benefit from additional documentation explaining:
- Why the value 8 was chosen
- Performance implications of different nesting levels
- Potential impact on gas costs
Line range hint
1124-1159
: Consider optimizing ownership verification for common cases.The
owns
function performs recursive ownership checking which could be gas-intensive for deeply nested objects. Consider:
- Caching intermediate ownership results
- Adding a non-recursive fast path for common cases
- Documenting the gas cost implications of deep nesting
Line range hint
1001-1013
: Consider emitting transfer event before state change.In
transfer_raw
, the ownership state is modified after emitting the event. This could lead to inconsistencies if the transaction fails after the state change but before event emission. Consider:
- Emitting the event before changing the state
- Adding a try-catch block for better error handling
public fun transfer_raw(owner: &signer, object: address, to: address) acquires ObjectCore { let owner_address = signer::address_of(owner); verify_ungated_and_descendant(owner_address, object); let object_core = borrow_global_mut<ObjectCore>(object); if (object_core.owner == to) { return }; + // Emit event before state change + event::emit(TransferEvent { object, from: object_core.owner, to }); + object_core.owner = to; - event::emit(TransferEvent { object, from: object_core.owner, to }); }
Line range hint
401-451
: Enhance error constant documentation.The error constants would benefit from more detailed documentation including:
- Specific scenarios that trigger each error
- Recommended actions for handling these errors
- Examples of proper error handling
precompile/modules/minitia_stdlib/doc/object.md (2)
553-553
: Document the rationale for MAXIMUM_OBJECT_NESTING valueThe value 8 for maximum nesting depth seems arbitrary. Consider adding documentation explaining why this specific value was chosen and what trade-offs were considered.
Line range hint
12-24
: Fix potential pricing anomaly in discount calculationThe current implementation has a critical business logic issue where applying a discount can result in a higher final price than without a discount. For example:
- Purchase of $100 with 10% discount = $90 + $20 fee = $110 (more than original price)
- Purchase of $100 with no discount = $100 (no fee)
This creates a negative incentive for customer loyalty.
Consider these alternatives:
- Apply the fee before the discount
- Scale the fee based on the purchase amount
- Only apply the fee for purchases above a certain threshold
Would you like me to propose a revised implementation?
precompile/modules/initia_stdlib/doc/stableswap.md (1)
Line range hint
1-1000
: Consider enhancing the documentation with examples.While the documentation is comprehensive, consider adding:
- Usage examples for key functions
- Common scenarios and best practices
- Parameter constraints and valid ranges
precompile/modules/initia_stdlib/doc/staking.md (4)
2119-2119
: Remove unnecessary line number commentsThe line number comments (2119~, 2488~, 2579~) before function definitions don't provide any value and could confuse readers. Consider removing them to maintain clean documentation.
/// Destroy empty delegation public fun destroy_empty_delegation(delegation: Delegation) /// Destroy empty unbonding public fun destroy_empty_unbonding(unbonding: Unbonding) /// Withdraw specified `amount` of unbonding_amount from the unbonding. public fun withdraw_unbonding(account: &signer, metadata: Object<Metadata>,...)Also applies to: 2488-2488, 2579-2579
Line range hint
2051-2077
: Add reward index validation in merge_delegationThe
merge_delegation
function merges two delegations but doesn't validate that their reward indices match. This could lead to incorrect reward calculations if the delegations have different reward indices.Consider adding a validation check:
public fun merge_delegation( dst_delegation: &mut Delegation, source_delegation: Delegation ): FungibleAsset acquires ModuleStore { assert!( dst_delegation.metadata == source_delegation.metadata, error::invalid_argument(EMETADATA_MISMATCH) ); assert!( dst_delegation.validator == source_delegation.validator, error::invalid_argument(EVALIDATOR_MISMATCH) ); + assert!( + dst_delegation.reward_index == source_delegation.reward_index, + error::invalid_argument(EREWARD_INDEX_MISMATCH) + );
Line range hint
378-379
: Improve error handling organization and messagesThe error constants could be better organized and have more descriptive messages. Consider:
- Grouping related errors together (e.g., all delegation errors, all unbonding errors)
- Adding more descriptive error messages in comments
-const ENOT_EMPTY: u64 = 7; +/// The delegation or unbonding still has non-zero share and cannot be destroyed +const ENOT_EMPTY: u64 = 7; -const ERELEASE_TIME: u64 = 9; +/// The source unbonding's release time must be <= destination's release time +const ERELEASE_TIME: u64 = 9; -const EDELEGATION_NOT_FOUND: u64 = 13; +/// The requested delegation entry was not found in storage +const EDELEGATION_NOT_FOUND: u64 = 13; -const EINSUFFICIENT_AMOUNT: u64 = 11; +/// The requested amount exceeds the available balance +const EINSUFFICIENT_AMOUNT: u64 = 11; -const EINVALID_START_AFTER: u64 = 14; +/// Invalid pagination parameters: start_after values must be consistently provided +const EINVALID_START_AFTER: u64 = 14;Also applies to: 384-385, 390-391, 396-397, 402-403
Line range hint
2673-2683
: Add detailed documentation for native functionsThe native functions
share_to_amount
andamount_to_share
lack detailed documentation about their behavior, edge cases, and potential failure scenarios.Consider adding comprehensive documentation:
+/// Converts a share amount to the corresponding token amount for a validator. +/// * `validator` - The validator's address in bytes +/// * `metadata` - The token metadata +/// * `share` - The share amount to convert +/// +/// # Errors +/// * Returns 0 if the validator has no total shares +/// * Rounds down to the nearest whole token amount native public fun share_to_amount( validator: vector<u8>, metadata: &Object<Metadata>, share: &BigDecimal ): u64; +/// Converts a token amount to the corresponding share amount for a validator. +/// * `validator` - The validator's address in bytes +/// * `metadata` - The token metadata +/// * `amount` - The token amount to convert +/// +/// # Errors +/// * Returns 0 shares if the validator has no total tokens +/// * May return fractional shares native public fun amount_to_share( validator: vector<u8>, metadata: &Object<Metadata>, amount: u64 ): BigDecimal;precompile/modules/initia_stdlib/doc/dex.md (1)
2587-2587
: Fix grammar in function documentationThe documentation for
single_asset_provide_liquidity
has a grammatical error. The sentence structure needs improvement.-Single asset provide liquidity directly +Provides liquidity using a single asset directly🧰 Tools
🪛 LanguageTool
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...(SINGULAR_NOUN_VERB_AGREEMENT)
precompile/modules/minitia_stdlib/doc/dex.md (2)
2587-2587
: Function signatures are accurate and well-documented.The function signatures match the changes mentioned in the AI summary, particularly for functions like
single_asset_provide_liquidity
,withdraw_liquidity
,swap
,create_pair
, andprovide_liquidity
.However, there's a minor grammatical issue in the comment:
-Single asset provide liquidity directly +Single asset provides liquidity directly🧰 Tools
🪛 LanguageTool
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...(SINGULAR_NOUN_VERB_AGREEMENT)
Line range hint
1-2587
: Consider improving documentation clarity with consistent grammar.The documentation is technically accurate, but some sections could benefit from more consistent grammar in the comments. For example:
- Use consistent tense (present tense) throughout function descriptions
- Ensure subject-verb agreement in function documentation
- Maintain consistent punctuation at the end of comments
Would you like me to help identify specific sections that could be improved?
🧰 Tools
🪛 LanguageTool
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...(SINGULAR_NOUN_VERB_AGREEMENT)
precompile/modules/initia_stdlib/doc/minitswap.md (2)
3965-3965
: Fix typo in comment: "metdata" should be "metadata"The word "metadata" is misspelled in the comment.
- // check metdata + // check metadata
4369-4369
: Fix typo in comment: "recalculate" should be "re-calculate"For better readability and consistency, the word "recalculate" should be hyphenated.
- // and recalculate offer amount repeatedly until return amount <= actual return amount + // and re-calculate offer amount repeatedly until return amount <= actual return amount
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (75)
.github/config/.codespellignore
(1 hunks).github/workflows/spellcheck.yml
(1 hunks)api/memory_test.go
(1 hunks)api/mocks.go
(3 hunks)crates/compiler/src/clean.rs
(1 hunks)crates/gas/src/lib.rs
(1 hunks)crates/gas/src/meter.rs
(1 hunks)crates/json/src/json_to_move.rs
(1 hunks)crates/json/src/json_to_value.rs
(1 hunks)crates/natives/src/function_info.rs
(1 hunks)crates/natives/src/move_stdlib/bcs.rs
(1 hunks)crates/types/src/compiler.rs
(1 hunks)crates/types/src/serde_helper/vec_bytes.rs
(1 hunks)precompile/modules/initia_stdlib/doc/coin.md
(3 hunks)precompile/modules/initia_stdlib/doc/collection.md
(1 hunks)precompile/modules/initia_stdlib/doc/dex.md
(1 hunks)precompile/modules/initia_stdlib/doc/dispatchable_fungible_asset.md
(2 hunks)precompile/modules/initia_stdlib/doc/ed25519.md
(1 hunks)precompile/modules/initia_stdlib/doc/fungible_asset.md
(1 hunks)precompile/modules/initia_stdlib/doc/math128.md
(1 hunks)precompile/modules/initia_stdlib/doc/math64.md
(1 hunks)precompile/modules/initia_stdlib/doc/minitswap.md
(2 hunks)precompile/modules/initia_stdlib/doc/nft.md
(1 hunks)precompile/modules/initia_stdlib/doc/object.md
(1 hunks)precompile/modules/initia_stdlib/doc/primary_fungible_store.md
(1 hunks)precompile/modules/initia_stdlib/doc/property_map.md
(1 hunks)precompile/modules/initia_stdlib/doc/stableswap.md
(1 hunks)precompile/modules/initia_stdlib/doc/staking.md
(4 hunks)precompile/modules/initia_stdlib/sources/coin.move
(3 hunks)precompile/modules/initia_stdlib/sources/crypto/ed25519.move
(1 hunks)precompile/modules/initia_stdlib/sources/dex.move
(2 hunks)precompile/modules/initia_stdlib/sources/fa/dispatchable_fungible_asset.move
(2 hunks)precompile/modules/initia_stdlib/sources/fa/fungible_asset.move
(1 hunks)precompile/modules/initia_stdlib/sources/fa/primary_fungible_store.move
(1 hunks)precompile/modules/initia_stdlib/sources/fixed_point64.move
(1 hunks)precompile/modules/initia_stdlib/sources/math128.move
(2 hunks)precompile/modules/initia_stdlib/sources/math64.move
(2 hunks)precompile/modules/initia_stdlib/sources/minitswap.move
(2 hunks)precompile/modules/initia_stdlib/sources/multisig.move
(2 hunks)precompile/modules/initia_stdlib/sources/object.move
(1 hunks)precompile/modules/initia_stdlib/sources/stableswap.move
(3 hunks)precompile/modules/initia_stdlib/sources/staking.move
(4 hunks)precompile/modules/initia_stdlib/sources/token/collection.move
(3 hunks)precompile/modules/initia_stdlib/sources/token/nft.move
(1 hunks)precompile/modules/initia_stdlib/sources/token/property_map.move
(1 hunks)precompile/modules/minitia_stdlib/README.md
(1 hunks)precompile/modules/minitia_stdlib/doc/coin.md
(3 hunks)precompile/modules/minitia_stdlib/doc/collection.md
(1 hunks)precompile/modules/minitia_stdlib/doc/dex.md
(1 hunks)precompile/modules/minitia_stdlib/doc/dispatchable_fungible_asset.md
(2 hunks)precompile/modules/minitia_stdlib/doc/ed25519.md
(1 hunks)precompile/modules/minitia_stdlib/doc/fungible_asset.md
(1 hunks)precompile/modules/minitia_stdlib/doc/math128.md
(1 hunks)precompile/modules/minitia_stdlib/doc/math64.md
(1 hunks)precompile/modules/minitia_stdlib/doc/nft.md
(1 hunks)precompile/modules/minitia_stdlib/doc/object.md
(1 hunks)precompile/modules/minitia_stdlib/doc/primary_fungible_store.md
(1 hunks)precompile/modules/minitia_stdlib/doc/property_map.md
(1 hunks)precompile/modules/minitia_stdlib/sources/coin.move
(3 hunks)precompile/modules/minitia_stdlib/sources/crypto/ed25519.move
(1 hunks)precompile/modules/minitia_stdlib/sources/dex.move
(2 hunks)precompile/modules/minitia_stdlib/sources/fa/dispatchable_fungible_asset.move
(2 hunks)precompile/modules/minitia_stdlib/sources/fa/fungible_asset.move
(1 hunks)precompile/modules/minitia_stdlib/sources/fa/primary_fungible_store.move
(1 hunks)precompile/modules/minitia_stdlib/sources/fixed_point64.move
(1 hunks)precompile/modules/minitia_stdlib/sources/math128.move
(2 hunks)precompile/modules/minitia_stdlib/sources/math64.move
(2 hunks)precompile/modules/minitia_stdlib/sources/multisig.move
(2 hunks)precompile/modules/minitia_stdlib/sources/object.move
(1 hunks)precompile/modules/minitia_stdlib/sources/token/collection.move
(3 hunks)precompile/modules/minitia_stdlib/sources/token/nft.move
(1 hunks)precompile/modules/minitia_stdlib/sources/token/property_map.move
(1 hunks)precompile/modules/move_nursery/doc/compare.md
(1 hunks)precompile/modules/move_nursery/sources/compare.move
(1 hunks)precompile/modules/move_stdlib/sources/signer.move
(1 hunks)
✅ Files skipped from review due to trivial changes (51)
- .github/config/.codespellignore
- api/memory_test.go
- api/mocks.go
- crates/compiler/src/clean.rs
- crates/gas/src/lib.rs
- crates/gas/src/meter.rs
- crates/natives/src/function_info.rs
- crates/natives/src/move_stdlib/bcs.rs
- crates/types/src/compiler.rs
- precompile/modules/initia_stdlib/doc/coin.md
- precompile/modules/initia_stdlib/doc/ed25519.md
- precompile/modules/initia_stdlib/doc/math128.md
- precompile/modules/initia_stdlib/doc/nft.md
- precompile/modules/initia_stdlib/doc/property_map.md
- precompile/modules/initia_stdlib/sources/coin.move
- precompile/modules/initia_stdlib/sources/crypto/ed25519.move
- precompile/modules/initia_stdlib/sources/dex.move
- precompile/modules/initia_stdlib/sources/fa/dispatchable_fungible_asset.move
- precompile/modules/initia_stdlib/sources/fa/primary_fungible_store.move
- precompile/modules/initia_stdlib/sources/fixed_point64.move
- precompile/modules/initia_stdlib/sources/minitswap.move
- precompile/modules/initia_stdlib/sources/multisig.move
- precompile/modules/initia_stdlib/sources/object.move
- precompile/modules/initia_stdlib/sources/stableswap.move
- precompile/modules/initia_stdlib/sources/staking.move
- precompile/modules/initia_stdlib/sources/token/collection.move
- precompile/modules/initia_stdlib/sources/token/nft.move
- precompile/modules/initia_stdlib/sources/token/property_map.move
- precompile/modules/minitia_stdlib/README.md
- precompile/modules/minitia_stdlib/doc/ed25519.md
- precompile/modules/minitia_stdlib/doc/fungible_asset.md
- precompile/modules/minitia_stdlib/doc/math128.md
- precompile/modules/minitia_stdlib/doc/math64.md
- precompile/modules/minitia_stdlib/doc/primary_fungible_store.md
- precompile/modules/minitia_stdlib/doc/property_map.md
- precompile/modules/minitia_stdlib/sources/coin.move
- precompile/modules/minitia_stdlib/sources/crypto/ed25519.move
- precompile/modules/minitia_stdlib/sources/dex.move
- precompile/modules/minitia_stdlib/sources/fa/dispatchable_fungible_asset.move
- precompile/modules/minitia_stdlib/sources/fa/fungible_asset.move
- precompile/modules/minitia_stdlib/sources/fa/primary_fungible_store.move
- precompile/modules/minitia_stdlib/sources/fixed_point64.move
- precompile/modules/minitia_stdlib/sources/math128.move
- precompile/modules/minitia_stdlib/sources/multisig.move
- precompile/modules/minitia_stdlib/sources/object.move
- precompile/modules/minitia_stdlib/sources/token/collection.move
- precompile/modules/minitia_stdlib/sources/token/nft.move
- precompile/modules/minitia_stdlib/sources/token/property_map.move
- precompile/modules/move_nursery/doc/compare.md
- precompile/modules/move_nursery/sources/compare.move
- precompile/modules/move_stdlib/sources/signer.move
🧰 Additional context used
🪛 LanguageTool
precompile/modules/initia_stdlib/doc/dex.md
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...
(SINGULAR_NOUN_VERB_AGREEMENT)
precompile/modules/initia_stdlib/doc/dispatchable_fungible_asset.md
[uncategorized] ~288-~288: Possible missing article found.
Context: ... The recipient is guaranteed to receive asset greater than the expected amount. Note:...
(AI_HYDRA_LEO_MISSING_AN)
precompile/modules/initia_stdlib/doc/primary_fungible_store.md
[uncategorized] ~663-~663: Possible missing article found.
Context: ...imum deposit assertion api to make sure recipient will receive a minimum amount of fund. ...
(AI_HYDRA_LEO_MISSING_THE)
precompile/modules/minitia_stdlib/doc/dex.md
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...
(SINGULAR_NOUN_VERB_AGREEMENT)
🔇 Additional comments (24)
.github/workflows/spellcheck.yml (1)
16-16
: Verify configuration file paths and existing workflows
Let's verify the configuration setup and check for potential conflicts.
✅ Verification successful
Configuration paths and workflow setup are correctly configured
The verification shows that:
- The
.codespellignore
file exists at the correct location (.github/config/.codespellignore
) - The file contains valid ignore patterns
- The workflow configuration is properly set up with the correct path reference
- No conflicting
.codespellignore
files were found in the repository
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify .codespellignore file location and check for similar workflows
# Check if .codespellignore exists in the specified location
if [ -f ".github/config/.codespellignore" ]; then
echo "✓ .codespellignore found"
else
echo "✗ .codespellignore not found at .github/config/.codespellignore"
fi
# Check for similar spell checking workflows
fd -e yml -e yaml . .github/workflows/ --exec grep -l "codespell" {}
Length of output: 207
Script:
#!/bin/bash
# Let's verify the content of both the workflow and ignore file to ensure proper configuration
# Check the content of .codespellignore
echo "=== .codespellignore content ==="
cat .github/config/.codespellignore
# Check the complete workflow configuration
echo -e "\n=== spellcheck.yml content ==="
cat .github/workflows/spellcheck.yml
# Check if there are any other .codespellignore files that might conflict
echo -e "\n=== Looking for other .codespellignore files ==="
fd codespellignore
Length of output: 1238
precompile/modules/initia_stdlib/sources/math64.move (2)
114-114
: LGTM: Comment spelling correction
The spelling correction from "treshold" to "threshold" improves documentation clarity.
277-283
: LGTM: Parameter name correction
The parameter name correction from "precission" to "precision" in the test helper function improves code clarity and consistency.
precompile/modules/minitia_stdlib/sources/math64.move (1)
114-114
: LGTM! Spelling correction in comment.
The spelling of "threshold" has been corrected, improving documentation quality.
precompile/modules/initia_stdlib/doc/math64.md (1)
304-304
: LGTM! Documentation improvement enhances clarity.
The spelling correction from "treshold" to "threshold" and the technical explanation about the quadratic convergence reaching below 2^-32 after 4 iterations provides valuable context for the implementation.
precompile/modules/initia_stdlib/sources/math128.move (1)
140-140
: LGTM: Spelling correction in comment
The spelling correction from "treshold" to "threshold" improves documentation clarity.
precompile/modules/initia_stdlib/doc/dispatchable_fungible_asset.md (2)
13-13
: LGTM: Spelling correction
The spelling correction from "transfered" to "transferred" is accurate.
Line range hint 1-24
: LGTM: Well-implemented dispatchable fungible asset module
The implementation demonstrates:
- Proper error handling with descriptive error codes
- Strong security controls for transfers and balance management
- Clear documentation and type safety
- Appropriate use of Move language patterns
precompile/modules/minitia_stdlib/doc/dispatchable_fungible_asset.md (1)
13-13
: LGTM!
The explanation of the transfer allowlist feature is clear and correctly written.
precompile/modules/minitia_stdlib/doc/nft.md (1)
Line range hint 1-24
: Implementation follows Move best practices.
The code demonstrates solid implementation with:
- Proper error handling and input validation
- Strong access control using capability pattern
- Event emission for tracking mutations
- Clear separation of concerns
Also applies to: 129-600
precompile/modules/minitia_stdlib/doc/coin.md (1)
Line range hint 1-1
: Verify all instances of the typo have been fixed.
The AI summary mentions fixing "metadat object" to "metadata object". Let's verify all instances have been corrected.
✅ Verification successful
Based on the search results, I can see that the term "metadat" appears only in legitimate contexts like "metadata" throughout the codebase, and there are no instances of the typo "metadat object". This suggests that the typo mentioned in the AI summary has already been fixed.
All instances of the term have been properly spelled as "metadata object"
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining instances of the typo
# Search for any remaining instances of "metadat"
rg -i "metadat" --type md
Length of output: 335314
crates/json/src/json_to_move.rs (1)
673-675
: LGTM! Good addition of error case test coverage.
The added test case verifies that the deserialization properly handles and rejects invalid hex addresses in vector elements, strengthening the validation of error handling paths.
precompile/modules/initia_stdlib/doc/collection.md (1)
Line range hint 447-456
: Enhance collection name validation.
The function only validates the length of the collection name but not its content. Consider adding validation for invalid characters to prevent potential security issues.
precompile/modules/minitia_stdlib/doc/collection.md (1)
Line range hint 392-396
: LGTM! Error handling is well-implemented.
The error handling using custom error codes and constants is well-structured and follows best practices.
precompile/modules/initia_stdlib/doc/primary_fungible_store.md (2)
Line range hint 1-9
: LGTM!
The module structure and imports are well-organized and follow Move language conventions.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~663-~663: Possible missing article found.
Context: ...imum deposit assertion api to make sure recipient will receive a minimum amount of fund. ...
(AI_HYDRA_LEO_MISSING_THE)
Line range hint 10-50
: LGTM!
The resource and struct definitions are well-designed with appropriate capabilities and documentation.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~663-~663: Possible missing article found.
Context: ...imum deposit assertion api to make sure recipient will receive a minimum amount of fund. ...
(AI_HYDRA_LEO_MISSING_THE)
precompile/modules/initia_stdlib/sources/fa/fungible_asset.move (2)
446-449
: LGTM!
The comment correction and function implementation are correct. The function properly checks for the existence of Metadata at the given address.
Line range hint 91-92
: Verify consistent usage of new error constants
Let's verify that the new error constants are used consistently throughout the codebase.
✅ Verification successful
Error constants are used consistently and appropriately
The verification shows that both error constants are used consistently and appropriately in the codebase:
ECONNOT_MANIPULATE_MODULE_ACCOUNT_STORE
(91) is used in module account store manipulation checksECANNOT_DEPOSIT_TO_BLOCKED_ACCOUNT
(92) is used in deposit validation checks for blocked accounts
Both constants are properly documented and used in their respective error scenarios without any conflicting or inconsistent usage.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check usage of new error constants
# Check for usage of module account store error
rg "ECONNOT_MANIPULATE_MODULE_ACCOUNT_STORE" -A 2
# Check for usage of blocked account error
rg "ECANNOT_DEPOSIT_TO_BLOCKED_ACCOUNT" -A 2
# Check for any other similar error constant names to avoid confusion
rg "E.*MANIPULATE.*STORE|E.*DEPOSIT.*BLOCKED" -A 2
Length of output: 21651
precompile/modules/initia_stdlib/doc/stableswap.md (1)
115-115
: LGTM: Documentation typo fix.
The correction from "Refernce" to "Reference" in the field description improves the documentation's accuracy.
precompile/modules/initia_stdlib/doc/fungible_asset.md (2)
1304-1304
: LGTM! The typographical error has been fixed.
The description for is_fungible_asset
function has been corrected from "Retrun" to "Return".
Line range hint 1-1304
: Documentation is comprehensive and well-structured.
The documentation provides clear and detailed information about:
- Resource and struct definitions with field descriptions
- Function signatures with parameter details
- Error codes with descriptive messages
- Event definitions and their usage
- Implementation details with proper code examples
precompile/modules/initia_stdlib/doc/staking.md (1)
Line range hint 1052-1102
: Review security implications of signer creation and fund movement
The slash_unbonding_for_chain
function creates a signer for the relayer account and handles fund movement. This requires careful security considerations:
- The
create_signer
call could be dangerous if not properly controlled - The function moves funds to the relayer account and then to the community pool
Consider:
- Adding explicit access control checks
- Documenting the security assumptions and requirements
- Adding events to track fund movements for transparency
precompile/modules/minitia_stdlib/doc/dex.md (2)
Line range hint 1-24
: Documentation structure looks good!
The documentation is well-organized with clear sections for resources, structs, functions, and events. The table of contents with anchor links provides good navigation.
🧰 Tools
🪛 LanguageTool
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...
(SINGULAR_NOUN_VERB_AGREEMENT)
Line range hint 1-2587
: Technical documentation is comprehensive and accurate.
The documentation effectively covers:
- Contract constraints and preconditions
- Error codes and their meanings
- Function behaviors and parameter descriptions
- Event emissions and their purposes
🧰 Tools
🪛 LanguageTool
[grammar] ~2587-~2587: There seems to be a noun/verb agreement error. Did you mean “provides” or “provided”?
Context: ..._asset_provide_liquidity` Single asset provide liquidity directly CONTRACT: cannot pro...
(SINGULAR_NOUN_VERB_AGREEMENT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
add a workflow for spellchecking and fix typos with this
due to typos in contracts, some of precompiled binaries are also updated.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
README.md
,coin.md
,collection.md
,dex.md
,dispatchable_fungible_asset.md
,ed25519.md
,fungible_asset.md
,math128.md
,math64.md
,nft.md
,object.md
,primary_fungible_store.md
,property_map.md
, andstableswap.md
.fungible_asset
module.