Skip to content

Commit

Permalink
tests/solidity/contracts: fix typo in OpCodes.sol (#24123)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltociear committed Dec 17, 2021
1 parent ada9c77 commit f5f5c08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/solidity/contracts/OpCodes.sol
Expand Up @@ -206,7 +206,7 @@ contract OpCodes {

assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer"
mstore(x,sig) //Place signature at begining of empty storage
mstore(x,sig) //Place signature at beginning of empty storage
mstore(add(x,0x04),a) // first address parameter. just after signature
mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes)
mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.
Expand All @@ -225,7 +225,7 @@ contract OpCodes {
//callcode
assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer"
mstore(x,sig) //Place signature at begining of empty storage
mstore(x,sig) //Place signature at beginning of empty storage
mstore(add(x,0x04),a) // first address parameter. just after signature
mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes)
mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.
Expand All @@ -244,7 +244,7 @@ contract OpCodes {
//delegatecall
assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer"
mstore(x,sig) //Place signature at begining of empty storage
mstore(x,sig) //Place signature at beginning of empty storage

This comment has been minimized.

Copy link
@Abeanna

Abeanna Apr 28, 2023

Goo6

mstore(add(x,0x04),a) // first address parameter. just after signature

This comment has been minimized.

Copy link
@Abeanna

Abeanna Apr 28, 2023

I

mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes)
mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.

This comment has been minimized.

Copy link
@Abeanna

Abeanna Apr 28, 2023

Ok

Expand Down

0 comments on commit f5f5c08

Please sign in to comment.