diff --git a/contracts/InterchainTokenService.sol b/contracts/InterchainTokenService.sol index 12873449..a2e2c342 100644 --- a/contracts/InterchainTokenService.sol +++ b/contracts/InterchainTokenService.sol @@ -493,8 +493,6 @@ contract InterchainTokenService is bytes calldata metadata, uint256 gasValue ) external payable whenNotPaused { - if (destinationAddress.length == 0) revert EmptyDestinationAddress(); - amount = _takeToken(tokenId, msg.sender, amount, false); (IGatewayCaller.MetadataVersion metadataVersion, bytes memory data) = _decodeMetadata(metadata); @@ -518,7 +516,6 @@ contract InterchainTokenService is bytes memory data, uint256 gasValue ) external payable whenNotPaused { - if (destinationAddress.length == 0) revert EmptyDestinationAddress(); if (data.length == 0) revert EmptyData(); amount = _takeToken(tokenId, msg.sender, amount, false); @@ -557,9 +554,6 @@ contract InterchainTokenService is uint256 amount, bytes calldata metadata ) external payable whenNotPaused { - if (sourceAddress == address(0)) revert EmptySourceAddress(); - if (destinationAddress.length == 0) revert EmptyDestinationAddress(); - amount = _takeToken(tokenId, sourceAddress, amount, true); (IGatewayCaller.MetadataVersion metadataVersion, bytes memory data) = _decodeMetadata(metadata); @@ -1044,6 +1038,7 @@ contract InterchainTokenService is bytes memory data, uint256 gasValue ) internal { + if (destinationAddress.length == 0) revert EmptyDestinationAddress(); if (amount == 0) revert ZeroAmount(); // slither-disable-next-line reentrancy-events diff --git a/contracts/interfaces/IInterchainTokenService.sol b/contracts/interfaces/IInterchainTokenService.sol index 61d89fb0..d2c52cab 100644 --- a/contracts/interfaces/IInterchainTokenService.sol +++ b/contracts/interfaces/IInterchainTokenService.sol @@ -53,7 +53,6 @@ interface IInterchainTokenService is error EmptyTokenName(); error EmptyTokenSymbol(); error EmptyParams(); - error EmptySourceAddress(); error EmptyDestinationAddress(); event InterchainTransfer( diff --git a/test/InterchainTokenService.js b/test/InterchainTokenService.js index 570b33c5..63b124ee 100644 --- a/test/InterchainTokenService.js +++ b/test/InterchainTokenService.js @@ -1363,18 +1363,6 @@ describe('Interchain Token Service', () => { await service.setPauseStatus(false).then((tx) => tx.wait); }); - it('Should revert on transmit send token when source address is zero address', async () => { - await expectRevert( - (gasOptions) => - service.transmitInterchainTransfer(tokenId, AddressZero, destinationChain, destAddress, amount, '0x', { - ...gasOptions, - value: gasValue, - }), - service, - 'EmptySourceAddress', - ); - }); - it('Should revert on transmit send token when destination address is zero address', async () => { await expectRevert( (gasOptions) => @@ -1383,7 +1371,7 @@ describe('Interchain Token Service', () => { value: gasValue, }), service, - 'EmptyDestinationAddress', + 'TakeTokenFailed', ); });