tests/solidity/contracts: fix typo in OpCodes.sol (#24123)

This commit is contained in:
Ikko Ashimine 2021-12-17 23:19:34 +09:00 committed by GitHub
parent ada9c774e9
commit f5f5c0855a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -206,7 +206,7 @@ contract OpCodes {
assembly { assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer" 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,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(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. mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.
@ -225,7 +225,7 @@ contract OpCodes {
//callcode //callcode
assembly { assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer" 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,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(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. mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.
@ -244,7 +244,7 @@ contract OpCodes {
//delegatecall //delegatecall
assembly { assembly {
let x := mload(0x40) //Find empty storage location using "free memory pointer" 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,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(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. mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function.