Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions contracts/anchors/bridged/AnchorBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ abstract contract AnchorBase is MerkleTreePoseidon, ReentrancyGuard, IAnchor {
// bridge events
event EdgeAddition(uint256 chainID, uint256 latestLeafIndex, bytes32 merkleRoot);
event EdgeUpdate(uint256 chainID, uint256 latestLeafIndex, bytes32 merkleRoot);
event RootHistoryRecorded(uint timestamp, bytes32[1] roots);
event RootHistoryUpdate(uint timestamp, bytes32[1] roots);

/**
@dev The constructor
Expand Down Expand Up @@ -336,14 +334,17 @@ abstract contract AnchorBase is MerkleTreePoseidon, ReentrancyGuard, IAnchor {
}

/** @dev */
function getLatestNeighborRoots() public view returns (bytes32[1] memory roots) {
for (uint256 i = 0; i < 1; i++) {
function getLatestNeighborRoots() public view returns (bytes32[] memory roots) {
roots = new bytes32[](maxEdges);
for (uint256 i = 0; i < maxEdges; i++) {
if (edgeList.length >= i + 1) {
roots[i] = edgeList[i].root;
} else {
roots[i] = bytes32(0x0);
// merkle tree height for zeros
roots[i] = zeros(levels);
}
}

}

/** @dev */
Expand Down
6 changes: 0 additions & 6 deletions contracts/anchors/bridged/LinkableAnchor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ abstract contract LinkableAnchor is AnchorBase, ILinkableAnchor {
uint32 neighborRootIndex = 0;
neighborRoots[sourceChainID][neighborRootIndex] = root;
emit EdgeAddition(sourceChainID, leafIndex, root);
// emit update event
bytes32[1] memory neighbors = getLatestNeighborRoots();
emit RootHistoryUpdate(block.timestamp, neighbors);
}

function updateEdge(
Expand All @@ -79,8 +76,5 @@ abstract contract LinkableAnchor is AnchorBase, ILinkableAnchor {
currentNeighborRootIndex[sourceChainID] = neighborRootIndex;
neighborRoots[sourceChainID][neighborRootIndex] = root;
emit EdgeUpdate(sourceChainID, leafIndex, root);
// emit update event
bytes32[1] memory neighbors = getLatestNeighborRoots();
emit RootHistoryUpdate(block.timestamp, neighbors);
}
}
1 change: 1 addition & 0 deletions contracts/verifiers/Verifier3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ contract Verifier3 {
uint[2] memory c,
uint[10] memory input
) public view returns (bool r) {

Proof memory proof;
proof.A = Pairing.G1Point(a[0], a[1]);
proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);
Expand Down
Loading