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

Allow fast_track to read mappings #18

Open
engn33r opened this issue Jul 17, 2023 · 3 comments
Open

Allow fast_track to read mappings #18

engn33r opened this issue Jul 17, 2023 · 3 comments
Labels
cfi For features that are considered for inclusion enhancement New feature or request help wanted Extra attention is needed

Comments

@engn33r
Copy link
Contributor

engn33r commented Jul 17, 2023

Is your feature request related to a problem? Please describe.

fast_track reads state variables. Some state variables are not as easy to read as uint256 variables. For example, consider price data provided by Chainlink. It can be requested with latestAnswer(), but the source data is stored in a uint32 -> Transmission mapping. If sothis can read from mappings, it will be easy to pull historic token price data directly from the blockchain without any data brokers.

img

Describe the solution you'd like

Read data from mappings. A new flag will be needed to identify which item in the mapping to read from. Handling of custom structs will be needed, likely with another flag which passes the struct layout/ABI.

Describe alternatives you've considered

None

Additional context

None

@makemake-kbo makemake-kbo added enhancement New feature or request help wanted Extra attention is needed cfi For features that are considered for inclusion labels Jul 25, 2023
@makemake-kbo
Copy link
Collaborator

this would be very interesting but also probably very tedious

@makemake-kbo
Copy link
Collaborator

this isnt that tedious but is not going to be appearing in sothis anytime soon.

For now, im working on a new tracking mode to track eth_call/staticcall outputs

@engn33r
Copy link
Contributor Author

engn33r commented Oct 15, 2023

Agreed, not a priority. For reference, cast index enables computing of a mapping value's storage slot (in solidity, not in vyper). And I was able to manually determine the storage slot for the chainlink mainnet ETH/USD price, it can be queried with cast --to-dec (cast storage 0x50ce56a3239671ab62f185704caedf626352741e 0x6200d9c0606964564958e1edf0b5d67e485691a223ce33e3267306cb461a390e)

An example is given in sothis-plotter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfi For features that are considered for inclusion enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants