-
Notifications
You must be signed in to change notification settings - Fork 21
Behavior of memory to storage copies #218
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
base: master
Are you sure you want to change the base?
Conversation
…/Documentation into shelly/gapsfromvoodoodoc
|
Going over the stale open doc PRs. @shellygr is this still relevant? If so, I'll review it |
|
Should be still true |
urikirsh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fixes and a question
| put into an array in storage. | ||
| This is done by the compiler using a 'copy-loop'. | ||
| The selector component `this.testPush.selector` requires one iteration. | ||
| the string `aa` requires three iterations: according to the [ABI specification](https://docs.soliditylang.org/en/v0.8.24/abi-spec.html), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| the string `aa` requires three iterations: according to the [ABI specification](https://docs.soliditylang.org/en/v0.8.24/abi-spec.html), | |
| The string `aa` requires three iterations: according to the [ABI specification](https://docs.soliditylang.org/en/v0.8.24/abi-spec.html), |
|
|
||
| Yes - when we copy `data` from memory to storage, the Solidity compiler | ||
| also generates code that nullifies the previous data. | ||
| As we do not know (and probably not wishing to constrain) the size of the previous data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| As we do not know (and probably not wishing to constrain) the size of the previous data, | |
| As we do not know (and probably do not wish to constrain) the size of the previous data, |
| } | ||
| ``` | ||
|
|
||
| The only difference in this new functionality is that we assume that the previous data has size of 225 bytes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The only difference in this new functionality is that we assume that the previous data has size of 225 bytes. | |
| The only difference in this new functionality is that we assume that the previous data has a size of 225 bytes. |
| The push to `myArray` generates the two aforementioned loops. | ||
| If we wish to analyze this code with the Prover, there are two questions to be answered: | ||
|
|
||
| 1. Do we need to set a value for `--loop_iter` which is bigger than 1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the prover smart enough to unroll the loop enough times for this case? The string is static
No description provided.