Skip to content

Commit

Permalink
Fix legitimate Slither findings (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominator008 authored Sep 22, 2023
1 parent 3c98349 commit d7a877c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
10 changes: 1 addition & 9 deletions src/adapters/BaseSenderAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,7 @@ abstract contract BaseSenderAdapter is IMessageSenderAdapter {
/// @param _toChainId is the destination chainId.
/// @param _to is the contract address on the destination chain.
function _getNewMessageId(uint256 _toChainId, address _to) internal returns (bytes32 messageId) {
messageId = keccak256(abi.encodePacked(getChainId(), _toChainId, nonce, address(this), _to));
messageId = keccak256(abi.encodePacked(block.chainid, _toChainId, nonce, address(this), _to));
++nonce;
}

/// @dev returns the chain id of the deployed adapter
/// @return cid is the chain identifier
function getChainId() public view virtual returns (uint256 cid) {
assembly {
cid := chainid()
}
}
}
2 changes: 1 addition & 1 deletion src/adapters/axelar/AxelarSenderAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract AxelarSenderAdapter is BaseSenderAdapter {
/*/////////////////////////////////////////////////////////////////
STATE VARIABLES
////////////////////////////////////////////////////////////////*/
IAxelarGasService public gasService;
IAxelarGasService public immutable gasService;
mapping(uint256 => string) public chainIdMap;

/*/////////////////////////////////////////////////////////////////
Expand Down
5 changes: 0 additions & 5 deletions test/unit-tests/adapters/BaseSenderAdapter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,4 @@ contract AxelarSenderAdapterTest is Setup {
vm.expectRevert(Error.ARRAY_LENGTH_MISMATCHED.selector);
adapter.updateReceiverAdapter(new uint256[](0), new address[](1));
}

/// @dev gets chian ID
function test_get_chain_id() public {
assertEq(adapter.getChainId(), SRC_CHAIN_ID);
}
}

0 comments on commit d7a877c

Please sign in to comment.