-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ contract Swap is UniversalContract { | |
address public immutable uniswapRouter; | ||
GatewayZEVM public gateway; | ||
uint256 constant BITCOIN = 18332; | ||
uint256 public gasLimit; | ||
Check warning Code scanning / Slither State variables that could be declared immutable Warning
Swap.gasLimit should be immutable
|
||
|
||
error InvalidAddress(); | ||
error Unauthorized(); | ||
|
@@ -24,11 +25,16 @@ contract Swap is UniversalContract { | |
_; | ||
} | ||
|
||
constructor(address payable gatewayAddress, address uniswapRouterAddress) { | ||
constructor( | ||
address payable gatewayAddress, | ||
address uniswapRouterAddress, | ||
uint256 gasLimitAmount | ||
) { | ||
if (gatewayAddress == address(0) || uniswapRouterAddress == address(0)) | ||
revert InvalidAddress(); | ||
uniswapRouter = uniswapRouterAddress; | ||
gateway = GatewayZEVM(gatewayAddress); | ||
gasLimit = gasLimitAmount; | ||
} | ||
|
||
struct Params { | ||
|
@@ -123,7 +129,7 @@ contract Swap is UniversalContract { | |
callOnRevert: true, | ||
abortAddress: address(0), | ||
revertMessage: abi.encode(sender, inputToken), | ||
onRevertGasLimit: 100000 | ||
onRevertGasLimit: gasLimit | ||
}) | ||
); | ||
} | ||
Check warning Code scanning / Slither Unused return Medium Check warning Code scanning / Slither Unused return Medium Check warning Code scanning / Slither Unused return Medium |
||
|
@@ -147,7 +153,7 @@ contract Swap is UniversalContract { | |
callOnRevert: false, | ||
abortAddress: address(0), | ||
revertMessage: "", | ||
onRevertGasLimit: 0 | ||
onRevertGasLimit: gasLimit | ||
}) | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ contract SwapToAnyToken is UniversalContract { | |
address public immutable uniswapRouter; | ||
GatewayZEVM public gateway; | ||
uint256 constant BITCOIN = 18332; | ||
uint256 public gasLimit; | ||
Check warning Code scanning / Slither State variables that could be declared immutable Warning
SwapToAnyToken.gasLimit should be immutable
|
||
|
||
error InvalidAddress(); | ||
error Unauthorized(); | ||
|
@@ -25,11 +26,16 @@ contract SwapToAnyToken is UniversalContract { | |
_; | ||
} | ||
|
||
constructor(address payable gatewayAddress, address uniswapRouterAddress) { | ||
constructor( | ||
address payable gatewayAddress, | ||
address uniswapRouterAddress, | ||
uint256 gasLimitAmount | ||
) { | ||
if (gatewayAddress == address(0) || uniswapRouterAddress == address(0)) | ||
revert InvalidAddress(); | ||
uniswapRouter = uniswapRouterAddress; | ||
gateway = GatewayZEVM(gatewayAddress); | ||
gasLimit = gasLimitAmount; | ||
} | ||
|
||
struct Params { | ||
|
@@ -163,7 +169,7 @@ contract SwapToAnyToken is UniversalContract { | |
callOnRevert: true, | ||
abortAddress: address(0), | ||
revertMessage: abi.encode(sender, inputToken), | ||
onRevertGasLimit: 0 | ||
onRevertGasLimit: gasLimit | ||
}) | ||
); | ||
} else { | ||
|
@@ -194,7 +200,7 @@ contract SwapToAnyToken is UniversalContract { | |
callOnRevert: false, | ||
abortAddress: address(0), | ||
revertMessage: "", | ||
onRevertGasLimit: 0 | ||
onRevertGasLimit: gasLimit | ||
}) | ||
); | ||
} | ||
|