You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sensitive Data Exposure: The PR includes hard-coded sensitive information (DOJO_ACCOUNT_ADDRESS and DOJO_PRIVATE_KEY) in contracts/scripts/env_variables.sh. This could lead to security vulnerabilities if the repository is public or compromised. It is recommended to manage sensitive data through environment variables or secure secrets management tools to avoid exposure.
⚡ Key issues to review
Sensitive Data Exposure The PR exposes sensitive data such as DOJO_ACCOUNT_ADDRESS and DOJO_PRIVATE_KEY directly in the script file. This poses a security risk as it can lead to unauthorized access if the repository is public or becomes compromised. It's recommended to use environment variables or secure vaults to handle sensitive data.
Replace hardcoded sensitive information with environment variables
Avoid hardcoding sensitive information such as private keys and account addresses directly in scripts. Use environment variables or secure vaults instead.
Why: Hardcoding sensitive information such as private keys and account addresses directly in scripts is a significant security risk. Using environment variables or secure vaults instead is a best practice to enhance security.
10
Replace hardcoded private keys with environment variable references
Avoid storing private keys in environment files, which can be exposed in version control. Use a secure vault or environment variable management system.
Why: Storing private keys in environment files can expose them in version control, posing a security risk. Using a secure vault or environment variable management system is a safer alternative.
10
Correct the state mutability settings to reflect actual function behavior
The state_mutability property is consistently set to "view" for several functions that do not modify state. However, for functions that clearly change the state (like set_world_config), it is set to "external". Ensure that the state_mutability accurately reflects the function's interaction with the contract's state, as incorrect settings can lead to security vulnerabilities.
Why: Ensuring that state_mutability accurately reflects the function's interaction with the contract's state is crucial for security. Incorrect settings can lead to vulnerabilities, making this suggestion highly important.
9
Implement input validation for numerical fields to prevent overflow and ensure data integrity
To avoid potential overflow issues and ensure data integrity, validate the input ranges for all functions accepting numerical inputs, especially where large integers (core::integer::u128) are used. Implement checks either in the smart contract functions or in the calling client application to prevent values that exceed the business logic's expected range.
-"type": "core::integer::u128"+"type": "core::integer::u128",+"validateRange": "0 to 1000000"
Suggestion importance[1-10]: 8
Why: Adding input validation for numerical fields is a significant improvement for security and data integrity. This helps prevent potential overflow issues and ensures that inputs adhere to expected ranges, which is critical for maintaining robust and secure contracts.
8
Enhancement
Add output to battle_claim to indicate operation success
Add a return type to the battle_claim function to provide feedback about the operation's success or result, improving the function's usability and debuggability.
Why: Providing feedback on the success of the battle_claim operation enhances usability and debuggability, making it easier to handle and diagnose issues.
9
Improve data integrity by using a larger integer type for entity_id
Consider using a more specific type than core::integer::u32 for entity_id in the create function to ensure data integrity and prevent potential overflow issues.
Why: Using a larger integer type can help prevent overflow issues and improve data integrity, but it may not be necessary if u32 is sufficient for the expected range of entity_id values.
7
Enhance the BuildingCategory enum to include associated data for scalability
Refactor the BuildingCategory enum to use associated data for each variant to allow future extensibility and additional metadata per category.
Why: Adding associated data to enum variants can improve extensibility, but it may add unnecessary complexity if the additional metadata is not currently needed.
6
Maintainability
Use a descriptive enum type for is_defensive_army to improve code clarity
Replace the core::bool type with a more descriptive enum for is_defensive_army to enhance readability and maintainability of the code.
Why: Replacing core::bool with a more descriptive enum enhances readability and maintainability, making the code more self-explanatory and reducing the risk of misinterpretation.
8
Modify namespace to avoid potential conflicts between different environments
Ensure that the namespace configuration under different profiles does not lead to conflicts or unintended behavior by maintaining unique namespaces or handling them conditionally in the code.
Why: Ensuring unique namespaces for different profiles can prevent conflicts and unintended behavior, improving maintainability. However, this change is not as critical as security-related suggestions.
7
Group related functions for better structure and readability
For better organization and readability, consider grouping related functions under a common parent in the JSON structure. For example, all functions related to configuration settings (set_world_config, set_mint_config, etc.) could be nested under a configurations key. This would make the structure more navigable and logical.
Why: Grouping related functions under a common parent key improves the organization and readability of the JSON structure. This enhances maintainability and makes the structure more logical, which is beneficial for developers navigating the code.
7
Best practice
Add error handling to deployment commands to improve robustness
Consider adding error handling for deployment commands to manage failures gracefully, such as checking the exit status of each command.
Why: Adding error handling for deployment commands ensures that failures are managed gracefully, improving the robustness and reliability of the deployment process.
8
Standardize integer types for consistency and clarity
It's recommended to use consistent naming conventions for types across your JSON schema. The type core::integer::u128 is used in multiple places, but similar types like core::integer::u8 and core::integer::u32 are also used. Consider using a consistent size for integer types where applicable, or clearly document the reason for using different sizes to avoid confusion and potential errors in data handling.
Why: The suggestion to standardize integer types is valid for consistency, but changing core::integer::u128 to core::integer::u64 might not be appropriate without understanding the specific requirements for each field. This suggestion addresses a minor issue related to code readability and maintainability.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
enhancement, configuration changes
Description
eternum-24
toeternum-25
inscripts/deploy.sh
.--name eternum
from thesozo migrate apply
command inscripts/deploy.sh
.STARKNET_RPC_URL
,DOJO_ACCOUNT_ADDRESS
, andDOJO_PRIVATE_KEY
incontracts/scripts/env_variables.sh
.dev
toprod
and updated RPC URL toeternum-25
incontracts/manifests/prod/deployment/manifest.toml
.contracts/manifests/prod/deployment/manifest.toml
.dojo-world
incontracts/manifests/prod/deployment/abis/dojo-world.json
.eternum-bank_systems
incontracts/manifests/prod/deployment/abis/contracts/eternum-bank_systems-85030190.json
.Changes walkthrough 📝
3 files
deploy.sh
Update deployment slots and migration command
scripts/deploy.sh
eternum-24
toeternum-25
.--name eternum
from thesozo migrate apply
command.env_variables.sh
Update environment variables for production
contracts/scripts/env_variables.sh
STARKNET_RPC_URL
to point toeternum-25
.DOJO_ACCOUNT_ADDRESS
andDOJO_PRIVATE_KEY
.manifest.toml
Update manifest for production deployment
contracts/manifests/prod/deployment/manifest.toml
dev
toprod
.eternum-25
.2 files
dojo-world.json
Add ABI definitions for dojo-world
contracts/manifests/prod/deployment/abis/dojo-world.json
dojo-world
.eternum-bank_systems-85030190.json
Add ABI definitions for eternum-bank systems
contracts/manifests/prod/deployment/abis/contracts/eternum-bank_systems-85030190.json
eternum-bank_systems
.90 files
eternum-config_systems-5f8c7cdc.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-config_systems-5f8c7cdc.json
...
eternum-Battle-20295758.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Battle-20295758.json
...
eternum-Building-a3631d0a.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Building-a3631d0a.json
...
eternum-Tile-5dfdf226.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Tile-5dfdf226.json
...
eternum-BuildingConfig-2050f944.json
...
contracts/manifests/prod/deployment/abis/models/eternum-BuildingConfig-2050f944.json
...
eternum-BuildingCategoryPopConfig-5804f847.json
...
contracts/manifests/prod/deployment/abis/models/eternum-BuildingCategoryPopConfig-5804f847.json
...
eternum-BuildingQuantityv2-31cdaf07.json
...
contracts/manifests/prod/deployment/abis/models/eternum-BuildingQuantityv2-31cdaf07.json
...
eternum-LevelingConfig-1c0257fd.json
...
contracts/manifests/prod/deployment/abis/models/eternum-LevelingConfig-1c0257fd.json
...
eternum-Army-5434a98b.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Army-5434a98b.json
...
eternum-MercenariesConfig-4c7248d4.json
...
contracts/manifests/prod/deployment/abis/models/eternum-MercenariesConfig-4c7248d4.json
...
eternum-Market-6dd46062.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Market-6dd46062.json
...
eternum-Liquidity-6c6683f5.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Liquidity-6c6683f5.json
...
eternum-TroopConfig-5b63d326.json
...
contracts/manifests/prod/deployment/abis/models/eternum-TroopConfig-5b63d326.json
...
eternum-Movable-68de8765.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Movable-68de8765.json
...
eternum-Trade-73cd5d50.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Trade-73cd5d50.json
...
eternum-Realm-68a0f35d.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Realm-68a0f35d.json
...
eternum-Structure-1ccc0e57.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Structure-1ccc0e57.json
...
eternum-Production-30841685.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Production-30841685.json
...
eternum-Bank-522579aa.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Bank-522579aa.json
...
eternum-HasClaimedStartingResources-636eaec7.json
...
contracts/manifests/prod/deployment/abis/models/eternum-HasClaimedStartingResources-636eaec7.json
...
eternum-GuildWhitelist-54f9b15d.json
...
contracts/manifests/prod/deployment/abis/models/eternum-GuildWhitelist-54f9b15d.json
...
eternum-MapExploreConfig-58fbbfce.json
...
contracts/manifests/prod/deployment/abis/models/eternum-MapExploreConfig-58fbbfce.json
...
eternum-OwnedResourcesTracker-660391c3.json
...
contracts/manifests/prod/deployment/abis/models/eternum-OwnedResourcesTracker-660391c3.json
...
eternum-StructureCount-754e52f0.json
...
contracts/manifests/prod/deployment/abis/models/eternum-StructureCount-754e52f0.json
...
eternum-Guild-22d294a4.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Guild-22d294a4.json
...
eternum-Road-426df582.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Road-426df582.json
...
eternum-combat_systems-27f37676.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-combat_systems-27f37676.json
...
eternum-ResourceAllowance-18a7f402.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ResourceAllowance-18a7f402.json
...
eternum-Contribution-5402ccc4.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Contribution-5402ccc4.json
...
eternum-DetachedResource-5ed63b97.json
...
contracts/manifests/prod/deployment/abis/models/eternum-DetachedResource-5ed63b97.json
...
eternum-CapacityConfig-620df1a7.json
...
contracts/manifests/prod/deployment/abis/models/eternum-CapacityConfig-620df1a7.json
...
eternum-ProductionInput-4aa7f2e2.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ProductionInput-4aa7f2e2.json
...
eternum-RoadConfig-424e8ddc.json
...
contracts/manifests/prod/deployment/abis/models/eternum-RoadConfig-424e8ddc.json
...
eternum-BankConfig-667de14b.json
...
contracts/manifests/prod/deployment/abis/models/eternum-BankConfig-667de14b.json
...
eternum-SpeedConfig-1e31ed6d.json
...
contracts/manifests/prod/deployment/abis/models/eternum-SpeedConfig-1e31ed6d.json
...
eternum-WeightConfig-4762f37e.json
...
contracts/manifests/prod/deployment/abis/models/eternum-WeightConfig-4762f37e.json
...
eternum-ProductionConfig-58cf51ed.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ProductionConfig-58cf51ed.json
...
eternum-ResourceCost-11ae7f37.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ResourceCost-11ae7f37.json
...
eternum-RealmFreeMintConfig-767aa72c.json
...
contracts/manifests/prod/deployment/abis/models/eternum-RealmFreeMintConfig-767aa72c.json
...
eternum-HyperstructureResourceConfig-34106fab.json
...
contracts/manifests/prod/deployment/abis/models/eternum-HyperstructureResourceConfig-34106fab.json
...
eternum-WorldConfig-7b79ae7c.json
...
contracts/manifests/prod/deployment/abis/models/eternum-WorldConfig-7b79ae7c.json
...
eternum-StaminaConfig-b6eb17a7.json
...
contracts/manifests/prod/deployment/abis/models/eternum-StaminaConfig-b6eb17a7.json
...
eternum-Stamina-64093ed8.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Stamina-64093ed8.json
...
eternum-ProductionOutput-3fcdac94.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ProductionOutput-3fcdac94.json
...
eternum-TickConfig-611cf60f.json
...
contracts/manifests/prod/deployment/abis/models/eternum-TickConfig-611cf60f.json
...
eternum-Progress-87eb8002.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Progress-87eb8002.json
...
eternum-Population-28c60ba8.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Population-28c60ba8.json
...
eternum-Resource-6aa2c384.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Resource-6aa2c384.json
...
eternum-Health-3bf465a5.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Health-3bf465a5.json
...
eternum-Level-12edd20f.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Level-12edd20f.json
...
eternum-Position-421d605b.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Position-421d605b.json
...
eternum-ArrivalTime-4dedc6c3.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ArrivalTime-4dedc6c3.json
...
eternum-ResourceTransferLock-6a7c4096.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ResourceTransferLock-6a7c4096.json
...
eternum-GuildMember-20ae0ece.json
...
contracts/manifests/prod/deployment/abis/models/eternum-GuildMember-20ae0ece.json
...
eternum-BattleConfig-60902e8b.json
...
contracts/manifests/prod/deployment/abis/models/eternum-BattleConfig-60902e8b.json
...
eternum-EntityOwner-23cb1be3.json
...
contracts/manifests/prod/deployment/abis/models/eternum-EntityOwner-23cb1be3.json
...
eternum-PopulationConfig-8cead3bb.json
...
contracts/manifests/prod/deployment/abis/models/eternum-PopulationConfig-8cead3bb.json
...
eternum-Protectee-6e671952.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Protectee-6e671952.json
...
eternum-Protector-177334e3.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Protector-177334e3.json
...
eternum-EntityMetadata-72b04193.json
...
contracts/manifests/prod/deployment/abis/models/eternum-EntityMetadata-72b04193.json
...
eternum-QuantityTracker-1889ed7d.json
...
contracts/manifests/prod/deployment/abis/models/eternum-QuantityTracker-1889ed7d.json
...
eternum-EntityName-8c850fbe.json
...
contracts/manifests/prod/deployment/abis/models/eternum-EntityName-8c850fbe.json
...
eternum-Owner-7395b328.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Owner-7395b328.json
...
eternum-ForeignKey-42013ea4.json
...
contracts/manifests/prod/deployment/abis/models/eternum-ForeignKey-42013ea4.json
...
eternum-Capacity-27d77858.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Capacity-27d77858.json
...
eternum-Orders-4423b5ef.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Orders-4423b5ef.json
...
eternum-AddressName-48fbe026.json
...
contracts/manifests/prod/deployment/abis/models/eternum-AddressName-48fbe026.json
...
eternum-Weight-24cf9d66.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Weight-24cf9d66.json
...
eternum-Quantity-3adcab42.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Quantity-3adcab42.json
...
eternum-Status-508b6172.json
...
contracts/manifests/prod/deployment/abis/models/eternum-Status-508b6172.json
...
eternum-building_systems-4b0f3026.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-building_systems-4b0f3026.json
...
eternum-guild_systems-38e127d4.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-guild_systems-38e127d4.json
...
eternum-trade_systems-7f6765dd.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-trade_systems-7f6765dd.json
...
eternum-realm_systems-2b08f0da.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-realm_systems-2b08f0da.json
...
eternum-travel_systems-4ec72d4c.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-travel_systems-4ec72d4c.json
...
eternum-liquidity_systems-337d668f.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-liquidity_systems-337d668f.json
...
eternum-resource_systems-59b73d5a.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-resource_systems-59b73d5a.json
...
eternum-hyperstructure_systems-3660009a.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-hyperstructure_systems-3660009a.json
...
eternum-swap_systems-216e8d44.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-swap_systems-216e8d44.json
...
eternum-road_systems-61d8f9c9.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-road_systems-61d8f9c9.json
...
eternum-map_systems-5431b122.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-map_systems-5431b122.json
...
eternum-dev_bank_systems-7a630ec9.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-dev_bank_systems-7a630ec9.json
...
eternum-dev_resource_systems-9f04ac8a.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-dev_resource_systems-9f04ac8a.json
...
eternum-name_systems-bbb2e543.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-name_systems-bbb2e543.json
...
manifest.json
...
contracts/manifests/prod/deployment/manifest.json
...
eternum-leveling_systems-5606a1c3.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-leveling_systems-5606a1c3.json
...
eternum-donkey_systems-4851519d.json
...
contracts/manifests/prod/deployment/abis/contracts/eternum-donkey_systems-4851519d.json
...
dojo-base.json
...
contracts/manifests/prod/deployment/abis/dojo-base.json
...
.env.production
...
client/.env.production
...
Scarb.toml
...
contracts/Scarb.toml
...