Skip to content

Commit

Permalink
FIX: V-WBT-VUL-005 + V-WBT-VUL-022
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Aug 25, 2023
1 parent 11c866f commit 2de3d5a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/contracts/contracts/SignatureBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
// Parse resourceID from the data
bytes32 resourceID = bytes32(data[0:32]);
require(
this.isCorrectExecutionChain(resourceID),
isCorrectExecutionChain(resourceID),
"SignatureBridge: Batch Executing on wrong chain"
);
address handler = _resourceIdToHandlerAddress[resourceID];
Expand All @@ -171,11 +171,11 @@ contract SignatureBridge is Governable, ChainIdWithType, ProposalNonceTracker {
address handlerAddress
) internal {
require(
this.isCorrectExecutionChain(resourceID),
isCorrectExecutionChain(resourceID),
"SignatureBridge::adminSetResourceWithSignature: Executing on wrong chain"
);
require(
this.isCorrectExecutionChain(newResourceID),
isCorrectExecutionChain(newResourceID),
"SignatureBridge::adminSetResourceWithSignature: Executing on wrong chain"
);
require(
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/hashers/PoseidonHasher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { SnarkConstants } from "./SnarkConstants.sol";
/// @notice This contract is meant to be used for poseidon merkle trees and other poseidon based hashing.
contract PoseidonHasher is SnarkConstants, IHasher {
function hash1(uint256 value) public pure returns (uint256) {
require(array[i] < SNARK_SCALAR_FIELD, "Value not in field");
require(value < SNARK_SCALAR_FIELD, "Value not in field");
uint256[1] memory input;
input[0] = value;
return PoseidonT2.poseidon(input);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/trees/MerkleForest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ contract MerkleForest is MerkleSystem {
}

/// @inheritdoc IMerkleSystem
function getZeroHash(uint32 index) external pure override returns (uint256) {
function getZeroHash(uint32 index) public pure override returns (uint256) {
return LinkableIncrementalBinaryTree.zeros(index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract contract MerkleTreeWithHistory is MerkleSystem {
}

/// @inheritdoc IMerkleSystem
function getZeroHash(uint32 index) external view override returns (uint256) {
function getZeroHash(uint32 index) public view override returns (uint256) {
return uint256(hasher.zeros(index));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/utils/ChainIdWithType.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract contract ChainIdWithType {

/// @notice Verifies that the current chain matches the chain ID from the resource ID
/// @param resourceID The resource ID to verify
function isCorrectExecutionChain(bytes32 resourceID) external view returns (bool) {
function isCorrectExecutionChain(bytes32 resourceID) public view returns (bool) {
uint64 executionChainId = parseChainIdFromResourceId(resourceID);
// Verify current chain matches chain ID from resource ID
return uint256(getChainIdType()) == uint256(executionChainId);
Expand Down

0 comments on commit 2de3d5a

Please sign in to comment.