Skip to content

Commit

Permalink
chore: fix naming slither findings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-N-Chernyshov committed Oct 12, 2023
1 parent fe8561c commit 8e1a108
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ethereum-bridge-contracts/contracts/ChannelHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ contract ChannelHandler is Ownable, ReentrancyGuard, IChannelHandler {
for (uint256 i = 0; i < messages.length; ++i) {
// Deliver the message to the target
// Delivery will have fixed maximum gas allowed for the target app
// slither-disable-next-line low-level-calls
bool success = false;
if (isApp[messages[i].target]) {
// slither-disable-next-line low-level-calls
(success, ) = messages[i].target.call{
value: 0,
gas: messages[i].max_gas
Expand Down
6 changes: 3 additions & 3 deletions ethereum-bridge-contracts/contracts/MasterToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ contract MasterToken is ERC20Burnable, Ownable {
* @dev Constructor that gives the specified address all of existing tokens.
*/
constructor(
string memory name,
string memory symbol,
string memory name_,
string memory symbol_,
address beneficiary,
uint256 supply,
bytes32 sideChainAssetId
) ERC20(name, symbol) {
) ERC20(name_, symbol_) {
sidechainAssetId = sideChainAssetId;
_mint(beneficiary, supply);
}
Expand Down
2 changes: 2 additions & 0 deletions ethereum-bridge-contracts/contracts/libraries/Bitfield.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ library Bitfield {
* @dev Constants used to efficiently calculate the hamming weight of a bitfield. See
* https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation for an explanation of those constants.
*/
// slither-disable-start too-many-digits
uint256 internal constant M1 =
0x5555555555555555555555555555555555555555555555555555555555555555;
uint256 internal constant M2 =
Expand All @@ -24,6 +25,7 @@ library Bitfield {
0x0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff;
uint256 internal constant M128 =
0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff;
// slither-disable-end too-many-digits

using Bits for uint256;

Expand Down
4 changes: 4 additions & 0 deletions ethereum-bridge-contracts/contracts/libraries/ScaleCodec.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ library ScaleCodec {
// * https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel

function reverse256(uint256 input) internal pure returns (uint256 v) {
// slither-disable-start too-many-digits
v = input;

// swap bytes
Expand Down Expand Up @@ -119,9 +120,11 @@ library ScaleCodec {

// swap 16-byte long pairs
v = (v >> 128) | (v << 128);
// slither-disable-end too-many-digits
}

function reverse128(uint128 input) internal pure returns (uint128 v) {
// slither-disable-start too-many-digits
v = input;

// swap bytes
Expand All @@ -141,6 +144,7 @@ library ScaleCodec {

// swap 8-byte long pairs
v = (v >> 64) | (v << 64);
// slither-disable-end too-many-digits
}

function reverse64(uint64 input) internal pure returns (uint64 v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ contract TestBeefyLightClient is BeefyLightClient {

function reset(
uint64 startingBeefyBlock,
ValidatorSet calldata _currentValidatorSet,
ValidatorSet calldata _nextValidatorSet
ValidatorSet calldata currentValidatorSet_,
ValidatorSet calldata nextValidatorSet_
) external onlyOwner {
currentValidatorSet = _currentValidatorSet;
nextValidatorSet = _nextValidatorSet;
currentValidatorSet = currentValidatorSet_;
nextValidatorSet = nextValidatorSet_;
latestBeefyBlock = startingBeefyBlock;
latestMMRRoots[0] = bytes32(0);
latestMMRRootIndex = 0;
Expand Down
4 changes: 2 additions & 2 deletions ethereum-bridge-contracts/contracts/test/TestToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity 0.8.15;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract TestToken is ERC20 {
constructor(string memory name, string memory symbol)
ERC20(name, symbol)
constructor(string memory name_, string memory symbol_)
ERC20(name_, symbol_)
{}

function mint(address to, uint256 amount) external {
Expand Down
6 changes: 3 additions & 3 deletions ethereum-bridge-contracts/contracts/test/TestToken721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ pragma solidity 0.8.15;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";

contract TestToken721 is ERC721URIStorage {
constructor(string memory name, string memory symbol) ERC721(name, symbol) {}
constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) {}

function mint(address to, uint256 tokenId) public {
_mint(to, tokenId);
}

function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) external {
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI_) external {
mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
_setTokenURI(tokenId, tokenURI_);
}
}

0 comments on commit 8e1a108

Please sign in to comment.