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

Testing: Set-Storage Determine Storage Slot from contract type VYPER-ONLY #362

Open
NotPeopling2day opened this issue Dec 21, 2021 · 2 comments
Labels
category: feature New feature or request category: SPIKE Research project size: 3 pieces Moderately challenging, well-defined, may require a bit of research

Comments

@NotPeopling2day
Copy link
Contributor

NotPeopling2day commented Dec 21, 2021

Overview

See the output format for storage slots from vyperlang/vyper#2572

Specification

The deliverable may just be a method (or helper method) on the vyper compiler
for getting the storage slot.

Dependencies

#360

This ticket can probably be moved to ape-vyper at some point.

@NotPeopling2day NotPeopling2day added category: feature New feature or request size: 3 pieces Moderately challenging, well-defined, may require a bit of research category: SPIKE Research project labels Dec 21, 2021
@NotPeopling2day NotPeopling2day changed the title Testing: Set-Storage: Vyper [SPIKE] Testing: Set-Storage Determine Storage Slot from contract type VYPER-ONLY Dec 21, 2021
@fubuloubu
Copy link
Member

see output format for storage slots from vyperlang/vyper#2572

@fubuloubu
Copy link
Member

fubuloubu commented Jul 29, 2023

Further sketch here:

assert token.balanceOf(a) == 0
# NOTE: `balanceOf` and `totalSupply` are storage slots, as well as public view methods
# NOTE: `balanceOf` is a `HashMap`, which can be used like a Python `dict`
token.storage.balanceOf[a] += 1000
token.storage.totalSupply += 1000  # To keep invariant in sync

assert token.balanceOf(a) == 1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: feature New feature or request category: SPIKE Research project size: 3 pieces Moderately challenging, well-defined, may require a bit of research
Projects
None yet
Development

No branches or pull requests

2 participants