fix CVF-21
This commit is contained in:
parent
8a82afba42
commit
53e7a69556
@ -149,9 +149,10 @@ contract TornadoTrees is Initializable {
|
|||||||
bytes32 deposit = offset + i >= depositsV1Length ? deposits[offset + i] : tornadoTreesV1.deposits(offset + i);
|
bytes32 deposit = offset + i >= depositsV1Length ? deposits[offset + i] : tornadoTreesV1.deposits(offset + i);
|
||||||
require(leafHash == deposit, "Incorrect deposit");
|
require(leafHash == deposit, "Incorrect deposit");
|
||||||
assembly {
|
assembly {
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x7c), blockNumber)
|
let itemOffset := add(data, mul(ITEM_SIZE, i))
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x78), instance)
|
mstore(add(itemOffset, 0x7c), blockNumber)
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x64), hash)
|
mstore(add(itemOffset, 0x78), instance)
|
||||||
|
mstore(add(itemOffset, 0x64), hash)
|
||||||
}
|
}
|
||||||
if (offset + i >= depositsV1Length) {
|
if (offset + i >= depositsV1Length) {
|
||||||
delete deposits[offset + i];
|
delete deposits[offset + i];
|
||||||
@ -200,9 +201,10 @@ contract TornadoTrees is Initializable {
|
|||||||
bytes32 withdrawal = offset + i >= withdrawalsV1Length ? withdrawals[offset + i] : tornadoTreesV1.withdrawals(offset + i);
|
bytes32 withdrawal = offset + i >= withdrawalsV1Length ? withdrawals[offset + i] : tornadoTreesV1.withdrawals(offset + i);
|
||||||
require(leafHash == withdrawal, "Incorrect withdrawal");
|
require(leafHash == withdrawal, "Incorrect withdrawal");
|
||||||
assembly {
|
assembly {
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x7c), blockNumber)
|
let itemOffset := add(data, mul(ITEM_SIZE, i))
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x78), instance)
|
mstore(add(itemOffset, 0x7c), blockNumber)
|
||||||
mstore(add(add(data, mul(ITEM_SIZE, i)), 0x64), hash)
|
mstore(add(itemOffset, 0x78), instance)
|
||||||
|
mstore(add(itemOffset, 0x64), hash)
|
||||||
}
|
}
|
||||||
if (offset + i >= withdrawalsV1Length) {
|
if (offset + i >= withdrawalsV1Length) {
|
||||||
delete withdrawals[offset + i];
|
delete withdrawals[offset + i];
|
||||||
|
Loading…
Reference in New Issue
Block a user