-
Notifications
You must be signed in to change notification settings - Fork 28
Deploy: metis token #331
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: master
Are you sure you want to change the base?
Deploy: metis token #331
Conversation
WalkthroughThis update introduces a new token contract, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TokenContract
participant Network
User->>TokenContract: Transfer tokens
TokenContract-->>Network: Verify transfer
Network-->>TokenContract: Confirmation
TokenContract-->>User: Transfer successful
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- deployments/dfk/Metis.json (1 hunks)
- deployments/klatyn/Metis.json (1 hunks)
- script/configs/SynapseERC20.symbols.json (1 hunks)
- script/networks.json (1 hunks)
Additional comments not posted (39)
script/configs/SynapseERC20.symbols.json (2)
2-7: LGTM!The entry for the "dfk" token under "Metis" is correctly defined with properties:
decimals,name, andsymbol.
8-12: LGTM!The entry for the "klatyn" token under "Metis" is correctly defined with properties:
decimals,name, andsymbol.script/networks.json (2)
10-10: LGTM!The argument for the "dfk" network has been correctly updated to include the
--verifier sourcifyoption, enhancing verification processes.
13-13: LGTM!The argument for the "klatyn" network has been correctly updated to include the
--verifier sourcifyoption, enhancing verification processes.deployments/dfk/Metis.json (3)
2-3: LGTM!The address and constructor arguments for the Metis token deployment on the "dfk" network are correctly defined.
4-542: LGTM!The ABI functions for the Metis token are correctly defined, covering all necessary functionalities.
543-667: LGTM!The ABI events for the Metis token are correctly defined, covering all necessary events.
deployments/klatyn/Metis.json (32)
6-17: Ensure proper access control forDEFAULT_ADMIN_ROLE.The
DEFAULT_ADMIN_ROLEfunction returns the default admin role identifier. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
19-30: Ensure proper access control forDOMAIN_SEPARATOR.The
DOMAIN_SEPARATORfunction returns the domain separator for EIP-712 signatures. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
32-43: Ensure proper access control forMINTER_ROLE.The
MINTER_ROLEfunction returns the minter role identifier. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
45-67: Verifyallowancefunction logic.The
allowancefunction returns the remaining number of tokens thatspenderwill be allowed to spend on behalf ofowner. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
69-91: Verifyapprovefunction logic.The
approvefunction sets the amount of tokens that anspenderis allowed to spend on behalf of theowner. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
93-110: VerifybalanceOffunction logic.The
balanceOffunction returns the token balance of a specific account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
112-123: Verifyburnfunction logic.The
burnfunction destroys a specified amount of tokens from the caller's account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
125-141: VerifyburnFromfunction logic.The
burnFromfunction destroys a specified amount of tokens from a specified account, deducting from the caller's allowance. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
143-154: Verifydecimalsfunction logic.The
decimalsfunction returns the number of decimals used to get its user representation. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
156-178: VerifydecreaseAllowancefunction logic.The
decreaseAllowancefunction decreases the amount of tokens that aspenderis allowed to spend on behalf of theowner. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
180-197: Ensure proper access control forgetRoleAdmin.The
getRoleAdminfunction returns the admin role that controls a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
199-221: Ensure proper access control forgetRoleMember.The
getRoleMemberfunction returns a member of a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
223-240: Ensure proper access control forgetRoleMemberCount.The
getRoleMemberCountfunction returns the number of members in a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
242-258: Ensure proper access control forgrantRole.The
grantRolefunction grants a specific role to an account. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
260-282: Ensure proper access control forhasRole.The
hasRolefunction checks if an account has a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
284-306: VerifyincreaseAllowancefunction logic.The
increaseAllowancefunction increases the amount of tokens that aspenderis allowed to spend on behalf of theowner. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
308-334: Verifyinitializefunction logic.The
initializefunction initializes the contract with the specified parameters. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
336-352: Verifymintfunction logic.The
mintfunction creates new tokens and assigns them to a specified account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
354-365: Verifynamefunction logic.The
namefunction returns the name of the token. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
367-384: Verifynoncesfunction logic.The
noncesfunction returns the current nonce for a specific account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
386-427: Verifypermitfunction logic.The
permitfunction allows a spender to spend a specific amount of tokens on behalf of the owner, using a signed message. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
429-445: Ensure proper access control forrenounceRole.The
renounceRolefunction allows an account to renounce a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
447-463: Ensure proper access control forrevokeRole.The
revokeRolefunction revokes a specific role from an account. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
465-476: Verifysymbolfunction logic.The
symbolfunction returns the symbol of the token. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
478-489: VerifytotalSupplyfunction logic.The
totalSupplyfunction returns the total supply of tokens. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
491-513: Verifytransferfunction logic.The
transferfunction transfers a specific amount of tokens to a specified recipient. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
515-542: VerifytransferFromfunction logic.The
transferFromfunction transfers a specific amount of tokens from a specified sender to a specified recipient. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
544-567: VerifyApprovalevent logic.The
Approvalevent is emitted when the allowance of aspenderfor anowneris set by a call toapprove. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
569-592: VerifyRoleAdminChangedevent logic.The
RoleAdminChangedevent is emitted when the admin role of a specific role is changed. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
594-617: VerifyRoleGrantedevent logic.The
RoleGrantedevent is emitted when a specific role is granted to an account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
619-642: VerifyRoleRevokedevent logic.The
RoleRevokedevent is emitted when a specific role is revoked from an account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
644-667: VerifyTransferevent logic.The
Transferevent is emitted when tokens are transferred from one account to another. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
Pull Request Test Coverage Report for Build 10700602434Details
💛 - Coveralls |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- script/bridge/VerifySynapseERC20.s.sol (1 hunks)
- script/bridge/check-synERC20.sh (1 hunks)
Additional comments not posted (15)
script/bridge/check-synERC20.sh (6)
1-3: LGTM!The shebang and usage comment are correct.
4-9: LGTM!The argument assignment and check are correctly implemented.
10-11: LGTM!The
findcommand is correctly used to locate the JSON files.
12-15: LGTM!The
sedcommand is correctly used to extract and format the chain names.
16-17: LGTM!The
echocommand is correctly used to print the chain names.
18-20: LGTM!The
forloop is correctly used to iterate over the chain names and run the verification script.script/bridge/VerifySynapseERC20.s.sol (9)
1-4: LGTM!The SPDX license identifier and pragma directives are correctly specified.
5-6: LGTM!The import statement for
SynapseERC20is correctly specified.
7-8: LGTM!The import statements for
BasicSynapseScriptandStringUtilsare correctly specified.
9-15: LGTM!The contract definition, struct, and constant are correctly specified.
17-35: LGTM!The state variables and the
runfunction are correctly specified.
37-44: LGTM!The
printMetadatafunction is correctly specified.
46-51: LGTM!The
addAddressfunction is correctly specified.
53-74: LGTM!The
checkRolefunction is correctly specified.
76-88: LGTM!The
findMemberandprintConditionfunctions are correctly specified.
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- deployments/metis/DefaultPoolCalc.json (1 hunks)
- deployments/metis/SwapQuoterV2.json (1 hunks)
- deployments/metis/WGAS.json (1 hunks)
- script/configs/metis/SwapQuoterV2.dc.json (1 hunks)
Files skipped from review due to trivial changes (1)
- deployments/metis/WGAS.json
Additional context used
Gitleaks
script/configs/metis/SwapQuoterV2.dc.json
7-7: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
13-13: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Additional comments not posted (5)
deployments/metis/DefaultPoolCalc.json (3)
2-3: LGTM: Address and constructor arguments.The address and constructor arguments are correctly formatted.
5-28: LGTM: ABI entry forcalculateAddLiquidity.The ABI entry for the
calculateAddLiquidityfunction is correctly formatted and follows the standard ABI structure.
4-29: LGTM: ABI array.The ABI array is correctly formatted and follows the standard ABI structure.
deployments/metis/SwapQuoterV2.json (2)
2-3: LGTM: Address and constructor arguments.The address and constructor arguments are correctly formatted.
4-702: LGTM: ABI entries.The ABI entries for multiple functions are correctly formatted and follow the standard ABI structure.
| "description": "nUSD", | ||
| "isLinked": false, | ||
| "pool": "0x555982d2E211745b96736665e19D9308B615F78e", | ||
| "token": "0x961318Fc85475E125B99Cc9215f62679aE5200aB" |
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.
Potential security issue: Generic API Key detected.
The token address 0x961318Fc85475E125B99Cc9215f62679aE5200aB is flagged as a potential generic API key. Ensure that this is not exposing any sensitive information.
Tools
Gitleaks
7-7: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
| "description": "nETH", | ||
| "isLinked": false, | ||
| "pool": "0x09fEC30669d63A13c666d2129230dD5588E2e240", | ||
| "token": "0x931B8f17764362A3325D30681009f0eDd6211231" |
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.
Potential security issue: Generic API Key detected.
The token address 0x931B8f17764362A3325D30681009f0eDd6211231 is flagged as a potential generic API key. Ensure that this is not exposing any sensitive information.
Tools
Gitleaks
13-13: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- script/configs/dfk/SynapseRouter.dc.json (2 hunks)
- script/configs/klatyn/SynapseRouter.dc.json (2 hunks)
- script/configs/metis/SynapseRouter.dc.json (3 hunks)
- script/router/SaveRouterConfig.s.sol (1 hunks)
Additional context used
Gitleaks
script/configs/metis/SynapseRouter.dc.json
34-34: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
38-38: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
script/configs/klatyn/SynapseRouter.dc.json
73-73: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
77-77: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
script/configs/dfk/SynapseRouter.dc.json
73-73: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
77-77: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Additional comments not posted (9)
script/router/SaveRouterConfig.s.sol (1)
32-32: Verify the impact of the change inwgasassignment logic.The code change simplifies the assignment of the
wgasvariable by removing the conditional check for the METIS chain ID. Previously, if the chain ID matchedMETIS_CHAINID,wgaswas set to the zero address; otherwise, it was assigned the deployment address of the "WGAS" contract.With this change,
wgaswill always be assigned the deployment address of "WGAS", regardless of the chain ID. This may impact how the contract interacts with the WGAS token on the METIS chain.Please verify if this change aligns with the intended behavior for the METIS chain. Consider the following:
- Is it acceptable for
wgasto be assigned the deployment address of "WGAS" on the METIS chain, instead of the zero address?- Are there any dependencies or interactions in other parts of the system that rely on the previous behavior of setting
wgasto the zero address for the METIS chain?Ensure that this change does not introduce any unintended consequences or break existing functionality related to the WGAS token on the METIS chain.
script/configs/metis/SynapseRouter.dc.json (3)
10-11: LGTM!The code changes are approved.
32-40: LGTM!The code changes are approved.
Note: The lines flagged by the static analysis tool (34 and 38) contain token addresses, not API keys. These are false positives and can be ignored.
Tools
Gitleaks
34-34: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
38-38: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
87-87: LGTM!The code changes are approved.
script/configs/klatyn/SynapseRouter.dc.json (2)
13-14: LGTM!The addition of "Metis" to the list of supported tokens is approved.
71-79: LGTM!The configuration for the "Metis" token is approved. It follows the same structure as the other token configurations and does not introduce any issues.
Tools
Gitleaks
73-73: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
77-77: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
script/configs/dfk/SynapseRouter.dc.json (3)
13-14: LGTM!The addition of "Metis" to the list of supported tokens in the SynapseRouter configuration is approved.
71-79: LGTM!The configuration provided for the "Metis" token is approved. It follows the expected structure and the parameter values are consistent with the other token configurations.
Tools
Gitleaks
73-73: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
77-77: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
73-73: Dismiss Gitleaks warnings.The lines flagged by Gitleaks contain token addresses, not API keys. Token addresses are public information and do not pose a security risk. These warnings can be dismissed as false positives.
Also applies to: 77-77
Tools
Gitleaks
73-73: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
Description
Fixes # (issue)
Checklist
Summary by CodeRabbit
New Features
Improvements
These enhancements aim to improve user experience and security while interacting with token functionalities on the blockchain.