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

CU-86drpncy1 - Add new methods on storage to get/put primitive values without the need of TypeHelper #1231

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

meevee98
Copy link
Contributor

@meevee98 meevee98 commented Apr 2, 2024

Summary or solution description
Implemented typed get and put storage methods to handle storage data with less verbosity

How to Reproduce

storage.put_int(SUPPLY_KEY, TOKEN_TOTAL_SUPPLY)
storage.put_uint160(OWNER_KEY, container.sender)
storage.put_int(container.sender, TOKEN_TOTAL_SUPPLY)

if not storage.get_bool(NOT_INITIALIZED):
# Used to check if the one who's transferring to this contract is the PERSON_A
address = storage.get_uint160(ADDRESS_PREFIX + PERSON_A)
# Used to check if PERSON_A has already transferred to this smart contract
funded_crypto = storage.get_int(FUNDED_PREFIX + PERSON_A)
# Used to check if PERSON_A is transferring the correct amount
amount_crypto = storage.get_int(AMOUNT_PREFIX + PERSON_A)
# Used to check if PERSON_A is transferring the correct token
token_crypto = storage.get_uint160(TOKEN_PREFIX + PERSON_A)

@meevee98 meevee98 self-assigned this Apr 2, 2024
@melanke
Copy link
Contributor

melanke commented Apr 2, 2024

@coveralls
Copy link
Collaborator

coveralls commented Apr 2, 2024

Coverage Status

coverage: 91.947% (+0.002%) from 91.945%
when pulling 2a45b5b on CU-86drpncy1
into d15ecaf on development.

@luc10921 luc10921 merged commit 2803e20 into development Apr 2, 2024
3 of 4 checks passed
@luc10921 luc10921 deleted the CU-86drpncy1 branch April 2, 2024 20:39
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

Successfully merging this pull request may close these issues.

4 participants