-
Notifications
You must be signed in to change notification settings - Fork 1
docs: permissioned mts tokens #50
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
📝 WalkthroughWalkthroughReflowed and reformatted the MultiVM Token Standard guide, added a new "Permissioned MultiVM Token" guide describing Injective's Permissions Module and Solidity integration ( Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 5
🤖 Fix all issues with AI Agents
In @.gitbook/developers-evm/multivm-token-standard.mdx:
- Line 34: The heading "Creating an** MTS-Compliant Token" contains an extra
asterisk and incorrect spacing; update the heading text to "Creating an
MTS-Compliant Token" (remove the extra asterisk and ensure a single space after
"an") in the multivm-token-standard.mdx file so the markdown renders correctly.
In @.gitbook/developers-evm/permissioned-multivm-token.mdx:
- Line 15: The phrase "real world assets" is missing a hyphen when used as a
compound adjective; update the text near "If you are tokenizing real world
assets (RWAs) using MTS on Injective," to "If you are tokenizing real‑world
assets (RWAs) using MTS on Injective," (i.e., hyphenate "real-world" so the
compound adjective correctly modifies "assets").
- Line 13: The heading "## Why Uses Permissions on MTS Tokens?" has incorrect
subject-verb agreement; change the header text to "## Why Use Permissions on MTS
Tokens?" by editing the markdown heading line containing that exact string so it
reads "Why Use" instead of "Why Uses".
- Around line 62-77: The code sample for isTransferRestricted uses an invalid
address literal ('0x...') causing a Solidity syntax error; replace the quoted
placeholder with a valid unquoted address literal (e.g., 0x1234... with proper
hex) or, better, change the example to use a state
variable/constructor-initialized immutable like restrictedAddress and update
isTransferRestricted to compare against that state variable; ensure the function
signature remains external view override (if using state) and remove the single
quotes around the address literal wherever restrictedAddress is defined.
- Line 60: The text contains a typographical error: replace the misspelled word
"exepct" with the correct spelling "except" in the sentence that currently reads
"exepct for ones involving a specific address" (update the token in the .mdx
content to "except" so the sentence reads "except for ones involving a specific
address").
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.gitbook/developers-evm/multivm-token-standard.mdx.gitbook/developers-evm/permissioned-multivm-token.mdx.gitbook/docs.json
🧰 Additional context used
🪛 LanguageTool
.gitbook/developers-evm/permissioned-multivm-token.mdx
[grammar] ~15-~15: Use a hyphen to join words.
Context: ... MTS Tokens? If you are tokenizing real world assets (RWAs) using MTS on Injecti...
(QB_NEW_EN_HYPHEN)
[grammar] ~59-~59: Ensure spelling is correct
Context: ... this function will allow all transfers, exepct for ones involving a specific address: ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🔇 Additional comments (2)
.gitbook/developers-evm/multivm-token-standard.mdx (1)
3-12: LGTM! Formatting improvements enhance readability.The reformatting changes improve line wrapping and readability without altering the technical content. The adjustments to line breaks, bullet points, and paragraph structure make the documentation easier to follow.
Also applies to: 42-94
.gitbook/docs.json (1)
1437-1440: LGTM! Redirect correctly configured.The redirect entry properly maps the old documentation path to the new location, ensuring backward compatibility for existing links to the permissioned MTS token documentation.
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
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: 0
🧹 Nitpick comments (1)
.gitbook/developers-evm/permissioned-multivm-token.mdx (1)
84-84: Simplify verbose phrasing.The phrase "In order to" can be simplified to "To" for more concise documentation.
🔎 Proposed fix
-In order to register the hook for the permissions, +To register the hook for the permissions,
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.gitbook/developers-evm/permissioned-multivm-token.mdx.gitbook/docs.json
🚧 Files skipped from review as they are similar to previous changes (1)
- .gitbook/docs.json
🧰 Additional context used
🪛 LanguageTool
.gitbook/developers-evm/permissioned-multivm-token.mdx
[grammar] ~15-~15: Use a hyphen to join words.
Context: ... MTS Tokens? If you are tokenizing real world assets (RWAs) using MTS on Injecti...
(QB_NEW_EN_HYPHEN)
[grammar] ~59-~59: Ensure spelling is correct
Context: ... this function will allow all transfers, exepct for ones involving a specific address: ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~83-~83: Consider a more concise word here.
Context: ...HookExamples.sol) ## Registering Hook In order to register the hook for the permissions, ...
(IN_ORDER_TO_PREMIUM)
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
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: 2
🤖 Fix all issues with AI Agents
In @.gitbook/developers-evm/permissioned-multivm-token.mdx:
- Around line 102-105: Fix the typo inside the Info block where the sentence
reads "That is an architectrual decision that is up to you." — change
"architectrual" to the correct spelling "architectural" so the sentence reads
"That is an architectural decision that is up to you."
- Around line 62-77: The isTransferRestricted example uses an invalid quoted
address literal; replace the quoted string in the restrictedAddress declaration
with a proper Solidity address value (remove the quotes and use a valid 0x...
hex address literal) or, better, reference a state variable/constructor-set
address (e.g., a contract-level restrictedAddress) so the function uses a proper
address type rather than a string.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.gitbook/developers-evm/multivm-token-standard.mdx.gitbook/developers-evm/permissioned-multivm-token.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- .gitbook/developers-evm/multivm-token-standard.mdx
🧰 Additional context used
🪛 LanguageTool
.gitbook/developers-evm/permissioned-multivm-token.mdx
[style] ~83-~83: Consider a more concise word here.
Context: ...HookExamples.sol) ## Registering Hook In order to register the hook for the permissions, ...
(IN_ORDER_TO_PREMIUM)
| ```solidity | ||
| function isTransferRestricted( | ||
| address from, | ||
| address to, | ||
| Cosmos.Coin calldata amount | ||
| ) external pure override returns (bool) { | ||
| address restrictedAddress = "0x..."; | ||
| if (from == restrictedAddress || to == restrictedAddress) { | ||
| // this particular address is not allowed to transfer | ||
| return true; | ||
| } | ||
| // All other transfers are allowed | ||
| return false; | ||
| } | ||
| ``` |
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.
Fix Solidity syntax error in code example.
Line 68 contains invalid Solidity syntax. Address literals in Solidity must not use quotes (single or double). The current example uses "0x..." which will cause a compilation error.
🔎 Proposed fix
function isTransferRestricted(
address from,
address to,
Cosmos.Coin calldata amount
) external pure override returns (bool) {
- address restrictedAddress = "0x...";
+ address restrictedAddress = 0x0000000000000000000000000000000000000000; // Replace with actual address
if (from == restrictedAddress || to == restrictedAddress) {
// this particular address is not allowed to transfer
return true;
}
// All other transfers are allowed
return false;
}Alternatively, for a more realistic example, consider using a state variable or constructor parameter as shown in the previous review.
🤖 Prompt for AI Agents
In @.gitbook/developers-evm/permissioned-multivm-token.mdx around lines 62 - 77,
The isTransferRestricted example uses an invalid quoted address literal; replace
the quoted string in the restrictedAddress declaration with a proper Solidity
address value (remove the quotes and use a valid 0x... hex address literal) or,
better, reference a state variable/constructor-set address (e.g., a
contract-level restrictedAddress) so the function uses a proper address type
rather than a string.
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
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: 1
🤖 Fix all issues with AI Agents
In @.gitbook/developers-evm/permissioned-multivm-token.mdx:
- Around line 149-152: Fix the typo in the documentation sentence under
"Reference Implementation": change "theat" to "that" so the sentence reads "A
more complete example that demonstrates the use of permissioned MTS tokens for a
stable coin is also available." Locate the phrase in the
.gitbook/developers-evm/permissioned-multivm-token.mdx content and update the
word accordingly.
🧹 Nitpick comments (1)
.gitbook/developers-evm/permissioned-multivm-token.mdx (1)
82-85: Consider more concise phrasing.The phrase "In order to register the hook for the permissions" is slightly verbose. Consider shortening to "To register the hook for the permissions" or "To register the permissions hook".
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.gitbook/developers-evm/permissioned-multivm-token.mdx
🧰 Additional context used
🪛 LanguageTool
.gitbook/developers-evm/permissioned-multivm-token.mdx
[style] ~83-~83: Consider a more concise word here.
Context: ...HookExamples.sol) ## Registering Hook In order to register the hook for the permissions, ...
(IN_ORDER_TO_PREMIUM)
[grammar] ~151-~151: Ensure spelling is correct
Context: ...Implementation A more complete example theat demonstrates the use of permissioned MT...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.