Skip to content

Commit 855a1c6

Browse files
committed
up
1 parent c33e933 commit 855a1c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contracts/utils/Base58.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ library Base58 {
6767
function clzBytes(ptr, length) -> i {
6868
for {
6969
i := 0
70-
} and(iszero(shr(248, mload(add(ptr, i)))), lt(i, length)) {
70+
} and(iszero(byte(0, mload(add(ptr, i)))), lt(i, length)) {
7171
i := add(i, 1)
7272
} {}
7373
}
@@ -100,12 +100,12 @@ library Base58 {
100100
} {
101101
let ptr := slotLength
102102
for {
103-
let carry := shr(248, mload(add(add(data, 0x20), i)))
103+
let carry := byte(0, mload(add(add(data, 0x20), i)))
104104
} or(carry, lt(end, ptr)) {
105105
ptr := sub(ptr, 1)
106106
carry := div(carry, 58)
107107
} {
108-
carry := add(carry, mul(256, shr(248, mload(add(add(encoded, 0x1f), ptr)))))
108+
carry := add(carry, mul(256, byte(0, mload(add(add(encoded, 0x1f), ptr)))))
109109
mstore8(add(add(encoded, 0x1f), ptr), mod(carry, 58))
110110
}
111111
end := ptr
@@ -129,7 +129,7 @@ library Base58 {
129129
} lt(i, encodedLength) {
130130
i := add(i, 1)
131131
} {
132-
mstore8(add(add(encoded, 0x20), i), mload(shr(248, mload(add(add(encoded, 0x20), add(offset, i))))))
132+
mstore8(add(add(encoded, 0x20), i), mload(byte(0, mload(add(add(encoded, 0x20), add(offset, i))))))
133133
}
134134

135135
// Store length and allocate (reserve) memory

0 commit comments

Comments
 (0)