-
Notifications
You must be signed in to change notification settings - Fork 332
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
🐛 Fix logMemory
in safeconsole
#591
Conversation
Sorry where is |
Lines 53 to 55 in 2cbff06
|
That signature you linked is |
So the library function is called You can try it yourself locally by testing the code from my PR: // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {Test} from "../src/Test.sol";
import {safeconsole} from "../src/safeconsole.sol";
/// @author philogy <https://github.com/philogy>
contract safeconsoleTest is Test {
struct A {
uint256 a;
uint256 b;
}
function test_logMemory() public pure {
A memory a = A(uint256(keccak256("a")), uint256(keccak256("b")));
safeconsole.logMemory(0x00, 0x100);
}
} Here also a link to foundry's actual definition of the underlying console interface: https://github.com/foundry-rs/foundry/blob/master/crates/evm/abi/src/HardhatConsole.json (you can use this query |
I see now, thank you! Not sure how I missed that when you linked to this 😅 Lines 53 to 55 in 2cbff06
|
No worries, happens, thanks for being so responsive! |
The
safeconsole.logMemory
method did not work as expected because it was calling thelogBytes(bytes)
method on the console pre-compile and notlog(bytes)
.I furthermore marked all assembly blocks as "memory safe" as it doesn't change memory and to prevent it from conflicting with certain viaIR optimizations.