Skip to content

Commit

Permalink
Make account code function more similar to stylus
Browse files Browse the repository at this point in the history
  • Loading branch information
gligneul committed Sep 27, 2024
1 parent cde7f96 commit b5fd6ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mocks/HostioTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b5fd6ec

Please sign in to comment.