cedra-labs / cedra-labs/move-contract-examples
[BUG] Documentation comments at wrong place in dex
- Dominant language
- Move
- Stars
- 5
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
**Description:**
Documentation comments are at the wrong place.
**Steps to reproduce:**
1. Run scripts/tests.sh
**Expected behavior:**
There should be no warnings.
**Actual behavior:**
There are warnings.
**Error messages:**
```
Testing: ./dex
INCLUDING DEPENDENCY CedraFramework
INCLUDING DEPENDENCY CedraStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING SimpleDex
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/1-math-amm.move:8:5
│
8 │ /// Calculate output amount using constant product formula
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/1-math-amm.move:9:5
│
9 │ /// Formula: x * y = k (constant)
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/1-math-amm.move:10:5
│
10 │ /// When we add dx to x, we get dy from y such that (x + dx) * (y - dy) = k
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/1-math-amm.move:28:5
│
28 │ /// Calculate required input for desired output
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/1-math-amm.move:45:5
│
45 │ /// Calculate optimal amounts for adding liquidity
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
warning: invalid documentation comment
┌─ /home/runner/work/move-contract-examples/move-contract-examples/dex/sources/2-swap.move:189:5
│
189 │ /// Get trading pair details including token addresses and reserves
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Documentation comment cannot be matched to a language item
```
**Environment:**
- OS: Ubuntu 24.04
- Cedra CLI version: 1.0.1
**Possible fix:**
Move the documentation comment as in the other examples not creating warnings.
Contributor guide
Research direction
Start by running scripts/tests.sh and inspect the documentation comments at the reported lines in dex/sources/1-math-amm.move and dex/sources/2-swap.move. Compare their placement with documentation comments in the other examples, then rerun the script; done means the build produces no invalid documentation comment warnings.
Written by the indexing model from the issue text.
Assessment
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100