Expressions for constant values such as a call to keccak256(), should use immutable rather than constant
It is expected that the value should be converted into a constant value at compile time, but actually the expression is re-calculated each time the constant is referenced
Since .tranfer() limits the allowed gas to 2300 units in the receiver's receive() or fallback() function it might result in DoS if the receiver is a contract address and has some logic in the receive() or fallback() function. Use .call{value: x}( and nonreentrant modifier or Checks-Effects-Interactions pattern.
There are 6 instances of this issue:
File: contracts/gas-service/AxelarGasService.sol
128: if (amount > 0) receiver.transfer(amount);
144: receiver.transfer(amount);
Expressions for constant values such as a call to
keccak256()
, should useimmutable
rather thanconstant
It is expected that the value should be converted into a constant value at compile time, but actually the expression is re-calculated each time the constant is referenced
There are 13 instances of this issue:
https://github.com/code-423n4/2022-07-axelar/tree/main/contracts/AxelarGateway.sol#L30-L43
Use
.call()
instead of.transfer()
Since
.tranfer()
limits the allowed gas to 2300 units in the receiver'sreceive()
orfallback()
function it might result in DoS if the receiver is a contract address and has some logic in thereceive()
orfallback()
function. Use.call{value: x}(
and nonreentrant modifier or Checks-Effects-Interactions pattern.There are 6 instances of this issue:
https://github.com/code-423n4/2022-07-axelar/tree/main/contracts/gas-service/AxelarGasService.sol#L128
https://github.com/code-423n4/2022-07-axelar/tree/main/contracts/deposit-service/ReceiverImplementation.sol#L23