Last active
July 26, 2022 17:37
-
-
Save CJ42/87d0a8cd8cee49bcc5eb7d2089406d21 to your computer and use it in GitHub Desktop.
Run this example in Remix + debug it to show that memory is erased between function calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| contract Source { | |
| Target target; | |
| constructor(Target _target) { | |
| target = _target; | |
| } | |
| function callTarget() public { | |
| target.doSomething(); | |
| } | |
| } | |
| contract Target { | |
| function doSomething() public { | |
| // do whatever | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment