diff --git a/contracts/nft/contracts/evm/UniversalNFT.sol b/contracts/nft/contracts/evm/UniversalNFT.sol index a60ce38..a07d694 100644 --- a/contracts/nft/contracts/evm/UniversalNFT.sol +++ b/contracts/nft/contracts/evm/UniversalNFT.sol @@ -20,7 +20,7 @@ abstract contract UniversalNFT is GatewayEVM public immutable gateway; uint256 private _nextTokenId; address public universal; - uint256 public immutable gasLimit; + uint256 public immutable gasLimitAmount; error InvalidAddress(); error Unauthorized(); @@ -41,7 +41,7 @@ abstract contract UniversalNFT is constructor(address payable gatewayAddress, uint256 gas) { if (gatewayAddress == address(0)) revert InvalidAddress(); if (gas == 0) revert InvalidGasLimit(); - gasLimit = gas; + gasLimitAmount = gas; gateway = GatewayEVM(gatewayAddress); } @@ -90,7 +90,7 @@ abstract contract UniversalNFT is true, address(0), abi.encode(receiver, tokenId, uri, msg.sender), - gasLimit + gasLimitAmount ) ); } diff --git a/contracts/nft/contracts/zetachain/UniversalNFT.sol b/contracts/nft/contracts/zetachain/UniversalNFT.sol index a69c2ea..b850cd6 100644 --- a/contracts/nft/contracts/zetachain/UniversalNFT.sol +++ b/contracts/nft/contracts/zetachain/UniversalNFT.sol @@ -26,7 +26,7 @@ abstract contract UniversalNFT is address public immutable uniswapRouter; uint256 private _nextTokenId; bool public isUniversal = true; - uint256 public immutable gasLimit; + uint256 public immutable gasLimitAmount; error TransferFailed(); error Unauthorized(); @@ -50,7 +50,7 @@ abstract contract UniversalNFT is if (gas == 0) revert InvalidGasLimit(); gateway = GatewayZEVM(gatewayAddress); uniswapRouter = uniswapRouterAddress; - gasLimit = gas; + gasLimitAmount = gas; } function setConnected( @@ -71,7 +71,7 @@ abstract contract UniversalNFT is _burn(tokenId); (, uint256 gasFee) = IZRC20(destination).withdrawGasFeeWithGasLimit( - gasLimit + gasLimitAmount ); if ( !IZRC20(destination).transferFrom(msg.sender, address(this), gasFee) @@ -85,14 +85,14 @@ abstract contract UniversalNFT is msg.sender ); - CallOptions memory callOptions = CallOptions(gasLimit, false); + CallOptions memory callOptions = CallOptions(gasLimitAmount, false); RevertOptions memory revertOptions = RevertOptions( address(this), true, address(0), abi.encode(tokenId, uri, msg.sender), - gasLimit + gasLimitAmount ); gateway.call( @@ -141,7 +141,7 @@ abstract contract UniversalNFT is emit TokenTransferReceived(receiver, tokenId, uri); } else { (, uint256 gasFee) = IZRC20(destination).withdrawGasFeeWithGasLimit( - gasLimit + gasLimitAmount ); uint256 out = SwapHelperLib.swapExactTokensForTokens( @@ -158,7 +158,7 @@ abstract contract UniversalNFT is out - gasFee, destination, abi.encode(receiver, tokenId, uri, out - gasFee, sender), - CallOptions(gasLimit, false), + CallOptions(gasLimitAmount, false), RevertOptions( address(this), true, diff --git a/contracts/token/contracts/evm/UniversalToken.sol b/contracts/token/contracts/evm/UniversalToken.sol index 3c68967..22c39df 100644 --- a/contracts/token/contracts/evm/UniversalToken.sol +++ b/contracts/token/contracts/evm/UniversalToken.sol @@ -10,7 +10,7 @@ import "../shared/Events.sol"; abstract contract UniversalToken is ERC20, Ownable2Step, Events { GatewayEVM public immutable gateway; address public universal; - uint256 public immutable gasLimit; + uint256 public immutable gasLimitAmount; error InvalidAddress(); error Unauthorized(); @@ -30,7 +30,7 @@ abstract contract UniversalToken is ERC20, Ownable2Step, Events { constructor(address payable gatewayAddress, uint256 gas) { if (gatewayAddress == address(0)) revert InvalidAddress(); - gasLimit = gas; + gasLimitAmount = gas; gateway = GatewayEVM(gatewayAddress); } @@ -67,7 +67,7 @@ abstract contract UniversalToken is ERC20, Ownable2Step, Events { true, address(0), abi.encode(amount, msg.sender), - gasLimit + gasLimitAmount ) ); } diff --git a/contracts/token/contracts/zetachain/UniversalToken.sol b/contracts/token/contracts/zetachain/UniversalToken.sol index d446017..3f36502 100644 --- a/contracts/token/contracts/zetachain/UniversalToken.sol +++ b/contracts/token/contracts/zetachain/UniversalToken.sol @@ -21,7 +21,7 @@ abstract contract UniversalToken is address public immutable uniswapRouter; uint256 private _nextTokenId; bool public isUniversal = true; - uint256 public immutable gasLimit; + uint256 public immutable gasLimitAmount; error TransferFailed(); error Unauthorized(); @@ -45,7 +45,7 @@ abstract contract UniversalToken is if (gas == 0) revert InvalidGasLimit(); gateway = GatewayZEVM(gatewayAddress); uniswapRouter = uniswapRouterAddress; - gasLimit = gas; + gasLimitAmount = gas; } function setConnected( @@ -65,7 +65,7 @@ abstract contract UniversalToken is _burn(msg.sender, amount); (, uint256 gasFee) = IZRC20(destination).withdrawGasFeeWithGasLimit( - gasLimit + gasLimitAmount ); if ( !IZRC20(destination).transferFrom(msg.sender, address(this), gasFee) @@ -73,14 +73,14 @@ abstract contract UniversalToken is IZRC20(destination).approve(address(gateway), gasFee); bytes memory message = abi.encode(receiver, amount, 0, msg.sender); - CallOptions memory callOptions = CallOptions(gasLimit, false); + CallOptions memory callOptions = CallOptions(gasLimitAmount, false); RevertOptions memory revertOptions = RevertOptions( address(this), true, address(0), abi.encode(amount, msg.sender), - gasLimit + gasLimitAmount ); gateway.call( @@ -114,7 +114,7 @@ abstract contract UniversalToken is _mint(receiver, tokenAmount); } else { (, uint256 gasFee) = IZRC20(destination).withdrawGasFeeWithGasLimit( - gasLimit + gasLimitAmount ); uint256 out = SwapHelperLib.swapExactTokensForTokens( uniswapRouter, @@ -129,7 +129,7 @@ abstract contract UniversalToken is out - gasFee, destination, abi.encode(receiver, tokenAmount, out - gasFee, sender), - CallOptions(gasLimit, false), + CallOptions(gasLimitAmount, false), RevertOptions( address(this), true,