Skip to content
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

[Local] Hardcoded Value in Local Deployment of Smart Storage Unit #63

Closed
ProtoDroidBot opened this issue Nov 22, 2024 · 3 comments
Closed
Assignees

Comments

@ProtoDroidBot
Copy link

Instructions followed as of 2024-11-22:
https://docs.evefrontier.com/QuickstartGuide
https://docs.evefrontier.com/SmartStorageUnit/deploy-smart-storage-unit-contracts
https://docs.evefrontier.com/SmartStorageUnit/configure-smart-storage-unit

Applies to local Docker Chain deployments only:

Problem: There is a hardcoded quantity of 7 items when using the Execute.s.sol script to test the configured ratios of the Smart Storage Unit.

Solution: Configure hardcoded value listed in Execute.s.sol (https://github.com/projectawakening/builder-examples/blob/develop/smart-storage-unit/packages/contracts/script/Execute.s.sol#L45) to use ratio values from .env file.

As a result, this will throw off people testing custom ratios for their local deployments. Below example has the following ratios configured:

IN_RATIO=5
OUT_RATIO=1

image

The location of the hardcoded quantity:

https://github.com/projectawakening/builder-examples/blob/develop/smart-storage-unit/packages/contracts/script/Execute.s.sol#L45

The definition for the world.call command where it lists the SmartStorageUnitSystem.execute, (smartStorageUnitId, 7, itemIn)) is below:

https://github.com/projectawakening/builder-examples/blob/develop/smart-storage-unit/packages/contracts/src/systems/SmartStorageUnitSystem.sol#L76

@CCP-Red-Dragon CCP-Red-Dragon self-assigned this Nov 22, 2024
@ProtoDroidBot
Copy link
Author

Apparently while reviewing the fixes Red Dragon that are currently in review, I found another potential fault with the ratios, (that coincidentally was fixed in the same pull-request):

Ratios can be set to -0 or any other negative number which would break the configure-ratio script.

829af59#diff-31b91b07ebe33e1d0d19f43747cd24abb0b7fedcc111540e1a7a1d17fab5c539L120

@CCP-Red-Dragon
Copy link
Contributor

CCP-Red-Dragon commented Nov 22, 2024

Both of these issues should hopefully be solved with #64 : )

Thank you very much for reporting the issue!! We really appreciate it.

@CCP-Red-Dragon
Copy link
Contributor

Have closed this issue due to the new PR hopefully solving the issue - please re-open if your still having the faults though :)

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants