diff options
author | Greg Hysen <greg.hysen@gmail.com> | 2018-05-26 08:20:00 +0800 |
---|---|---|
committer | Greg Hysen <greg.hysen@gmail.com> | 2018-06-08 06:38:47 +0800 |
commit | d17e031259e11e3e37cbb837245171cbdd4d219b (patch) | |
tree | c56cbcac2f6c1a5806437a5589620b0f0f6b4a68 | |
parent | 842363200b3b8aded3b03fc8e46a329ff9534e36 (diff) | |
download | dexon-sol-tools-d17e031259e11e3e37cbb837245171cbdd4d219b.tar.gz dexon-sol-tools-d17e031259e11e3e37cbb837245171cbdd4d219b.tar.zst dexon-sol-tools-d17e031259e11e3e37cbb837245171cbdd4d219b.zip |
Fixed up wording in memcpy
-rw-r--r-- | packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol b/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol index b07a5da54..215a661e2 100644 --- a/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol +++ b/packages/contracts/src/contracts/current/utils/LibMem/LibMem.sol @@ -82,8 +82,8 @@ contract LibMem { // Example: // Suppose a word of 8 bits has all 1's: [11111111] // Let X = 7 (we want to free the first 7 bits, and retain the last bit) - // Apply a left shift of 1: [11111110] - // Apply a right shift of 1: [01111111] + // Apply a left shift of 7: [10000000] + // Apply a right shift of 7: [00000001] let destShiftFactor := exp(2, mul(8, remainder)) let destWord := mload(add(dest, offset)) let destBytes := div(mul(destWord, destShiftFactor), destShiftFactor) @@ -92,7 +92,7 @@ contract LibMem { // The source bytes run from [0..X-1] and the dest bytes from [X..31]. // Example: // Following the example from above, we have [11111110] - // from the source word and [01111111] from the dest word. + // from the source word and [00000001] from the dest word. // Combine these words using <or> to get [11111111]. let combinedDestWord := or(sourceBytes, destBytes) |