From b5fd6ecbaa0bc37f946f07278c4c543d992b095b Mon Sep 17 00:00:00 2001 From: Gabriel de Quadros Ligneul Date: Fri, 27 Sep 2024 14:55:31 -0300 Subject: [PATCH] Make account code function more similar to stylus --- src/mocks/HostioTest.sol | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mocks/HostioTest.sol b/src/mocks/HostioTest.sol index 2256f733..8add2336 100644 --- a/src/mocks/HostioTest.sol +++ b/src/mocks/HostioTest.sol @@ -76,7 +76,14 @@ contract HostioTest { } function accountCode(address account) external view returns (bytes memory) { - return account.code; + uint256 size = 10000; + bytes memory code = new bytes(size); + assembly { + extcodecopy(account, add(code, 32), 0, size) + size := extcodesize(account) + mstore(code, size) + } + return code; } function accountCodeSize(address account) external view returns (uint256) {