-
Notifications
You must be signed in to change notification settings - Fork 28
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
Deploy: metis token #331
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 sourcify
option, enhancing verification processes.
13-13
: LGTM!The argument for the "klatyn" network has been correctly updated to include the
--verifier sourcify
option, 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_ROLE
function 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_SEPARATOR
function 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_ROLE
function returns the minter role identifier. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
45-67
: Verifyallowance
function logic.The
allowance
function returns the remaining number of tokens thatspender
will be allowed to spend on behalf ofowner
. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
69-91
: Verifyapprove
function logic.The
approve
function sets the amount of tokens that anspender
is allowed to spend on behalf of theowner
. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
93-110
: VerifybalanceOf
function logic.The
balanceOf
function returns the token balance of a specific account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
112-123
: Verifyburn
function logic.The
burn
function 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
: VerifyburnFrom
function logic.The
burnFrom
function 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
: Verifydecimals
function logic.The
decimals
function 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
: VerifydecreaseAllowance
function logic.The
decreaseAllowance
function decreases the amount of tokens that aspender
is 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
getRoleAdmin
function 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
getRoleMember
function 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
getRoleMemberCount
function 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
grantRole
function 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
hasRole
function checks if an account has a specific role. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
284-306
: VerifyincreaseAllowance
function logic.The
increaseAllowance
function increases the amount of tokens that aspender
is allowed to spend on behalf of theowner
. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
308-334
: Verifyinitialize
function logic.The
initialize
function initializes the contract with the specified parameters. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
336-352
: Verifymint
function logic.The
mint
function 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
: Verifyname
function logic.The
name
function returns the name of the token. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
367-384
: Verifynonces
function logic.The
nonces
function returns the current nonce for a specific account. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
386-427
: Verifypermit
function logic.The
permit
function 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
renounceRole
function 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
revokeRole
function revokes a specific role from an account. Ensure that proper access control mechanisms are in place to prevent unauthorized access.
465-476
: Verifysymbol
function logic.The
symbol
function returns the symbol of the token. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
478-489
: VerifytotalSupply
function logic.The
totalSupply
function returns the total supply of tokens. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
491-513
: Verifytransfer
function logic.The
transfer
function 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
: VerifytransferFrom
function logic.The
transferFrom
function 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
: VerifyApproval
event logic.The
Approval
event is emitted when the allowance of aspender
for anowner
is set by a call toapprove
. Ensure that the logic correctly handles edge cases and potential integer overflow issues.
569-592
: VerifyRoleAdminChanged
event logic.The
RoleAdminChanged
event 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
: VerifyRoleGranted
event logic.The
RoleGranted
event 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
: VerifyRoleRevoked
event logic.The
RoleRevoked
event 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
: VerifyTransfer
event logic.The
Transfer
event 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
find
command is correctly used to locate the JSON files.
12-15
: LGTM!The
sed
command is correctly used to extract and format the chain names.
16-17
: LGTM!The
echo
command is correctly used to print the chain names.
18-20
: LGTM!The
for
loop 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
SynapseERC20
is correctly specified.
7-8
: LGTM!The import statements for
BasicSynapseScript
andStringUtils
are correctly specified.
9-15
: LGTM!The contract definition, struct, and constant are correctly specified.
17-35
: LGTM!The state variables and the
run
function are correctly specified.
37-44
: LGTM!The
printMetadata
function is correctly specified.
46-51
: LGTM!The
addAddress
function is correctly specified.
53-74
: LGTM!The
checkRole
function is correctly specified.
76-88
: LGTM!The
findMember
andprintCondition
functions 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
calculateAddLiquidity
function 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 inwgas
assignment logic.The code change simplifies the assignment of the
wgas
variable by removing the conditional check for the METIS chain ID. Previously, if the chain ID matchedMETIS_CHAINID
,wgas
was set to the zero address; otherwise, it was assigned the deployment address of the "WGAS" contract.With this change,
wgas
will 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
wgas
to 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
wgas
to 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.