Compare commits
No commits in common. "699835588729d2f36b37aa4caecddef7a85209d3" and "a6bca9e27f3fef14053b8a85c207e02866927e29" have entirely different histories.
6998355887
...
a6bca9e27f
@ -1,20 +0,0 @@
|
|||||||
// SPDX-License-Identifier: MIT
|
|
||||||
pragma solidity ^0.8.20;
|
|
||||||
|
|
||||||
import {Weaver} from "../types/Weaver.sol";
|
|
||||||
|
|
||||||
contract WeaverMock is Weaver {
|
|
||||||
constructor() Weaver() {}
|
|
||||||
|
|
||||||
function insertTreeNode(bytes32 receiver, uint256 amount) external returns (uint256) {
|
|
||||||
return _insertTreeNode(receiver, amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
function computeArgumentsHash(
|
|
||||||
uint256 index,
|
|
||||||
uint256 amount,
|
|
||||||
bytes32 receiver
|
|
||||||
) external pure returns (bytes32) {
|
|
||||||
return _computeArgumentsHash(index, amount, receiver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -52,10 +52,7 @@ abstract contract Weaver is IWeaver {
|
|||||||
bytes32 left = bytes32(_treeNodes[session][j].upperLookup(atBlock));
|
bytes32 left = bytes32(_treeNodes[session][j].upperLookup(atBlock));
|
||||||
bytes32 right = bytes32(_treeNodes[session][j | 1].upperLookup(atBlock));
|
bytes32 right = bytes32(_treeNodes[session][j | 1].upperLookup(atBlock));
|
||||||
|
|
||||||
bytes32 leftHash = Hashes.efficientKeccak256(left);
|
currentLevel[i] = Hashes.efficientKeccak256(left, right);
|
||||||
bytes32 rightHash = Hashes.efficientKeccak256(right);
|
|
||||||
|
|
||||||
currentLevel[i] = Hashes.efficientKeccak256(leftHash, rightHash);
|
|
||||||
unchecked { ++i; }
|
unchecked { ++i; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,8 +89,7 @@ abstract contract Weaver is IWeaver {
|
|||||||
uint256 i;
|
uint256 i;
|
||||||
|
|
||||||
for (; i < currentLevelCount;) {
|
for (; i < currentLevelCount;) {
|
||||||
bytes32 leaf = bytes32(_treeNodes[session][i].upperLookup(atBlock));
|
currentLevel[i] = bytes32(_treeNodes[session][i].upperLookup(atBlock));
|
||||||
currentLevel[i] = Hashes.efficientKeccak256(leaf);
|
|
||||||
unchecked { ++i; }
|
unchecked { ++i; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,6 +144,6 @@ abstract contract Weaver is IWeaver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _computeArgumentsHash(uint256 i, uint256 a, bytes32 r) internal pure returns (bytes32) {
|
function _computeArgumentsHash(uint256 i, uint256 a, bytes32 r) internal pure returns (bytes32) {
|
||||||
return Hashes.efficientKeccak256(Hashes.efficientKeccak256(bytes32(a), r), bytes32(i));
|
return Hashes.efficientKeccak256(bytes32(i), Hashes.efficientKeccak256(bytes32(a), r));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,8 +76,6 @@ contract GatekeeperVerification is Gatekeeper {
|
|||||||
unchecked { ++i; }
|
unchecked { ++i; }
|
||||||
}
|
}
|
||||||
|
|
||||||
computedHash = Hashes.efficientKeccak256(computedHash);
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (; i < proof.length; ) {
|
for (; i < proof.length; ) {
|
||||||
if (slotIndex % 2 == 0) {
|
if (slotIndex % 2 == 0) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user