From 873020e9dbe8448510a6c4f8c0f7554e525e9530 Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 9 Jan 2025 14:03:45 +0200 Subject: [PATCH] remove autoScaling --- contracts/InterchainTokenFactory.sol | 49 ------------ contracts/InterchainTokenService.sol | 11 +-- .../interfaces/IInterchainTokenService.sol | 3 - test/InterchainTokenService.js | 74 ++++++++----------- test/InterchainTokenServiceFullFlow.js | 10 +-- test/InterchainTokenServiceUpgradeFlow.js | 2 +- 6 files changed, 37 insertions(+), 112 deletions(-) diff --git a/contracts/InterchainTokenFactory.sol b/contracts/InterchainTokenFactory.sol index fc1b3894..12248b91 100644 --- a/contracts/InterchainTokenFactory.sol +++ b/contracts/InterchainTokenFactory.sol @@ -27,7 +27,6 @@ contract InterchainTokenFactory is IInterchainTokenFactory, ITokenManagerType, M bytes32 internal constant PREFIX_CANONICAL_TOKEN_SALT = keccak256('canonical-token-salt'); bytes32 internal constant PREFIX_INTERCHAIN_TOKEN_SALT = keccak256('interchain-token-salt'); bytes32 internal constant PREFIX_DEPLOY_APPROVAL = keccak256('deploy-approval'); - bytes32 internal constant PREFIX_CUSTOM_TOKEN_SALT = keccak256('custom-token-salt'); address private constant TOKEN_FACTORY_DEPLOYER = address(0); IInterchainTokenService public immutable interchainTokenService; @@ -416,7 +415,6 @@ contract InterchainTokenFactory is IInterchainTokenFactory, ITokenManagerType, M currentChain, tokenAddress.toBytes(), TokenManagerType.LOCK_UNLOCK, - true, '', gasValue ); @@ -492,53 +490,6 @@ contract InterchainTokenFactory is IInterchainTokenFactory, ITokenManagerType, M tokenId = deployRemoteCanonicalInterchainToken(originalTokenAddress, destinationChain, gasValue); } - function linkedTokenDeploySalt(address deployer, bytes32 salt) public view returns (bytes32 deploySalt) { - deploySalt = keccak256(abi.encode(PREFIX_CUSTOM_TOKEN_SALT, chainNameHash, deployer, salt)); - } - - function linkedTokenId(address deployer, bytes32 salt) external view returns (bytes32 tokenId) { - bytes32 deploySalt = linkedTokenDeploySalt(deployer, salt); - tokenId = _interchainTokenId(deploySalt); - } - - function registerCustomToken( - bytes32 salt, - address tokenAddress, - TokenManagerType tokenManagerType, - address operator, - uint256 gasValue - ) external payable returns (bytes32 tokenId) { - bytes32 deploySalt = linkedTokenDeploySalt(msg.sender, salt); - bytes memory operatorBytes = ''; - string memory currentChain = ''; - if (operator != address(0)) { - operatorBytes = operator.toBytes(); - } - - tokenId = interchainTokenService.linkToken(deploySalt, currentChain, tokenAddress.toBytes(), tokenManagerType, operatorBytes, 0); - - interchainTokenService.registerTokenMetadata{ value: gasValue }(tokenAddress, gasValue); - } - - function linkToken( - bytes32 salt, - string calldata destinationChain, - bytes calldata destinationTokenAddress, - TokenManagerType tokenManagerType, - bytes calldata linkParams, - uint256 gasValue - ) external payable returns (bytes32 tokenId) { - bytes32 deploySalt = linkedTokenDeploySalt(msg.sender, salt); - tokenId = interchainTokenService.linkToken( - deploySalt, - destinationChain, - destinationTokenAddress, - tokenManagerType, - linkParams, - gasValue - ); - } - /********************\ |* Pure Key Getters *| \********************/ diff --git a/contracts/InterchainTokenService.sol b/contracts/InterchainTokenService.sol index 240bf101..c4d58c98 100644 --- a/contracts/InterchainTokenService.sol +++ b/contracts/InterchainTokenService.sol @@ -317,7 +317,6 @@ contract InterchainTokenService is string calldata destinationChain, bytes memory destinationTokenAddress, TokenManagerType tokenManagerType, - bool autoScaling, bytes memory linkParams, uint256 gasValue ) public payable whenNotPaused returns (bytes32 tokenId) { @@ -346,7 +345,7 @@ contract InterchainTokenService is } else { if (chainNameHash == keccak256(bytes(destinationChain))) revert CannotDeployRemotelyToSelf(); - _linkToken(tokenId, destinationChain, destinationTokenAddress, tokenManagerType, autoScaling, linkParams, gasValue); + _linkToken(tokenId, destinationChain, destinationTokenAddress, tokenManagerType, linkParams, gasValue); } } @@ -753,8 +752,8 @@ contract InterchainTokenService is * @notice Processes a deploy token manager payload. */ function _processLinkTokenPayload(bytes memory payload) internal { - (, bytes32 tokenId, TokenManagerType tokenManagerType, , bytes memory destinationTokenAddress, , bytes memory linkParams) = abi - .decode(payload, (uint256, bytes32, TokenManagerType, bytes, bytes, bool, bytes)); + (, bytes32 tokenId, TokenManagerType tokenManagerType, , bytes memory destinationTokenAddress, bytes memory linkParams) = abi + .decode(payload, (uint256, bytes32, TokenManagerType, bytes, bytes, bytes)); if (tokenManagerType == TokenManagerType.NATIVE_INTERCHAIN_TOKEN) revert CannotDeploy(tokenManagerType); @@ -908,7 +907,6 @@ contract InterchainTokenService is * @param destinationChain The chain where the token manager will be deployed. * @param destinationTokenAddress The address of the token on the destination chain. * @param tokenManagerType The type of token manager to be deployed. - * @param autoScaling Whether to enable auto scaling of decimals for the interchain token. * @param params Additional parameters for the token linking. * @param gasValue The amount of gas to be paid for the transaction. */ @@ -917,7 +915,6 @@ contract InterchainTokenService is string calldata destinationChain, bytes memory destinationTokenAddress, TokenManagerType tokenManagerType, - bool autoScaling, bytes memory params, uint256 gasValue ) internal { @@ -930,7 +927,6 @@ contract InterchainTokenService is sourceTokenAddress, destinationTokenAddress, tokenManagerType, - autoScaling, params ); @@ -940,7 +936,6 @@ contract InterchainTokenService is tokenManagerType, sourceTokenAddress, destinationTokenAddress, - autoScaling, params ); diff --git a/contracts/interfaces/IInterchainTokenService.sol b/contracts/interfaces/IInterchainTokenService.sol index c38b2f2e..5b40518f 100644 --- a/contracts/interfaces/IInterchainTokenService.sol +++ b/contracts/interfaces/IInterchainTokenService.sol @@ -78,7 +78,6 @@ interface IInterchainTokenService is bytes sourceTokenAddress, bytes destinationTokenAddress, TokenManagerType indexed tokenManagerType, - bool autoScaling, bytes params ); event InterchainTokenDeploymentStarted( @@ -185,7 +184,6 @@ interface IInterchainTokenService is * @param destinationChain The name of the destination chain. * @param destinationTokenAddress The address of the token on the destination chain. * @param tokenManagerType The type of token manager. Cannot be NATIVE_INTERCHAIN_TOKEN. - * @param autoScaling Whether to enable auto scaling of decimals for the interchain token. * @param linkParams The link parameters. * @param gasValue The gas value for deployment. * @return tokenId The tokenId associated with the token manager. @@ -195,7 +193,6 @@ interface IInterchainTokenService is string calldata destinationChain, bytes memory destinationTokenAddress, TokenManagerType tokenManagerType, - bool autoScaling, bytes memory linkParams, uint256 gasValue ) external payable returns (bytes32 tokenId); diff --git a/test/InterchainTokenService.js b/test/InterchainTokenService.js index 868d0013..cda9f10e 100644 --- a/test/InterchainTokenService.js +++ b/test/InterchainTokenService.js @@ -60,7 +60,6 @@ describe('Interchain Token Service', () => { const salt = getRandomBytes32(); const tokenId = await service.interchainTokenId(wallet.address, salt); const tokenManager = await getContractAt('TokenManager', await service.tokenManagerAddress(tokenId), wallet); - const autoScaling = false; const token = await deployContract(wallet, 'TestInterchainTokenStandard', [ tokenName, @@ -70,7 +69,7 @@ describe('Interchain Token Service', () => { tokenId, ]); - await service.linkToken(salt, '', token.address, LOCK_UNLOCK, autoScaling, wallet.address, 0).then((tx) => tx.wait); + await service.linkToken(salt, '', token.address, LOCK_UNLOCK, wallet.address, 0).then((tx) => tx.wait); if (mintAmount > 0) { await token.mint(wallet.address, mintAmount).then((tx) => tx.wait); @@ -92,7 +91,6 @@ describe('Interchain Token Service', () => { const salt = getRandomBytes32(); const tokenId = await service.interchainTokenId(wallet.address, salt); const tokenManager = await getContractAt('TokenManager', await service.tokenManagerAddress(tokenId), wallet); - const autoScaling = false; let token; @@ -122,7 +120,7 @@ describe('Interchain Token Service', () => { ]); } - await service.linkToken(salt, '', token.address, LOCK_UNLOCK_FEE_ON_TRANSFER, autoScaling, wallet.address, 0).then((tx) => tx.wait); + await service.linkToken(salt, '', token.address, LOCK_UNLOCK_FEE_ON_TRANSFER, wallet.address, 0).then((tx) => tx.wait); if (mintAmount > 0) { await token.mint(wallet.address, mintAmount).then((tx) => tx.wait); @@ -146,7 +144,6 @@ describe('Interchain Token Service', () => { service.address, tokenId, ]); - const autoScaling = false; const tokenManager = await getContractAt('TokenManager', await service.tokenManagerAddress(tokenId), wallet); @@ -156,7 +153,7 @@ describe('Interchain Token Service', () => { await token.transferMintership(tokenManager.address).then((tx) => tx.wait); - await service.linkToken(salt, '', token.address, type, autoScaling, wallet.address, 0).then((tx) => tx.wait); + await service.linkToken(salt, '', token.address, type, wallet.address, 0).then((tx) => tx.wait); return [token, tokenManager, tokenId]; }; @@ -542,7 +539,7 @@ describe('Interchain Token Service', () => { const salt = getRandomBytes32(); await expectRevert( - (gasOptions) => serviceTest.linkToken(salt, chainName, testToken.address, LOCK_UNLOCK, true, '0x', 0, gasOptions), + (gasOptions) => serviceTest.linkToken(salt, chainName, testToken.address, LOCK_UNLOCK, '0x', 0, gasOptions), serviceTest, 'CannotDeployRemotelyToSelf', ); @@ -713,7 +710,7 @@ describe('Interchain Token Service', () => { before(async () => { salt = getRandomBytes32(); - await service.linkToken(salt, '', testToken.address, LOCK_UNLOCK, true, '0x', 0).then((tx) => tx.wait); + await service.linkToken(salt, '', testToken.address, LOCK_UNLOCK, '0x', 0).then((tx) => tx.wait); }); it('Should initialize a remote interchain token deployment', async () => { @@ -848,7 +845,6 @@ describe('Interchain Token Service', () => { const tokenName = 'Token Name'; const tokenSymbol = 'TN'; const tokenDecimals = 13; - const autoScaling = false; let token, salt, tokenId; let tokenManagerProxy; @@ -865,12 +861,12 @@ describe('Interchain Token Service', () => { }); it('Should revert on deploying an invalid token manager', async () => { - await expectRevert((gasOptions) => service.linkToken(salt, '', token.address, 6, autoScaling, wallet.address, 0, gasOptions)); + await expectRevert((gasOptions) => service.linkToken(salt, '', token.address, 6, wallet.address, 0, gasOptions)); }); it('Should revert on deploying a local token manager with invalid params', async () => { await expectRevert( - (gasOptions) => service.linkToken(salt, '', token.address, NATIVE_INTERCHAIN_TOKEN, autoScaling, '0x', 0, gasOptions), + (gasOptions) => service.linkToken(salt, '', token.address, NATIVE_INTERCHAIN_TOKEN, '0x', 0, gasOptions), service, 'CannotDeploy', ); @@ -879,7 +875,7 @@ describe('Interchain Token Service', () => { it('Should revert on deploying a local token manager with interchain token manager type', async () => { await expectRevert( (gasOptions) => - service.linkToken(salt, '', token.address, NATIVE_INTERCHAIN_TOKEN, autoScaling, wallet.address, 0, gasOptions), + service.linkToken(salt, '', token.address, NATIVE_INTERCHAIN_TOKEN, wallet.address, 0, gasOptions), service, 'CannotDeploy', [NATIVE_INTERCHAIN_TOKEN], @@ -894,7 +890,6 @@ describe('Interchain Token Service', () => { destinationChain, token.address, NATIVE_INTERCHAIN_TOKEN, - autoScaling, wallet.address, 0, gasOptions, @@ -907,7 +902,7 @@ describe('Interchain Token Service', () => { it('Should revert on deploying a token manager if token handler post deploy fails', async () => { await expectRevert( - (gasOptions) => service.linkToken(salt, '', AddressZero, LOCK_UNLOCK, autoScaling, wallet.address, 0, gasOptions), + (gasOptions) => service.linkToken(salt, '', AddressZero, LOCK_UNLOCK, wallet.address, 0, gasOptions), service, 'PostDeployFailed', ); @@ -919,7 +914,7 @@ describe('Interchain Token Service', () => { await expect( reportGas( - service.linkToken(salt, '', token.address, LOCK_UNLOCK, autoScaling, wallet.address, 0), + service.linkToken(salt, '', token.address, LOCK_UNLOCK, wallet.address, 0), 'Call deployTokenManager on source chain', ), ) @@ -949,7 +944,7 @@ describe('Interchain Token Service', () => { it('Should revert when deploying a custom token manager twice', async () => { const revertData = keccak256(toUtf8Bytes('AlreadyDeployed()')).substring(0, 10); await expectRevert( - (gasOptions) => service.linkToken(salt, '', token.address, LOCK_UNLOCK, autoScaling, wallet.address, 0, gasOptions), + (gasOptions) => service.linkToken(salt, '', token.address, LOCK_UNLOCK, wallet.address, 0, gasOptions), service, 'TokenManagerDeploymentFailed', [revertData], @@ -985,7 +980,7 @@ describe('Interchain Token Service', () => { ]); const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); - const tx = service.linkToken(salt, '', token.address, MINT_BURN, autoScaling, wallet.address, 0); + const tx = service.linkToken(salt, '', token.address, MINT_BURN, wallet.address, 0); const expectedTokenManagerAddress = await service.tokenManagerAddress(tokenId); await expect(tx).to.emit(service, 'TokenManagerDeployed').withArgs(tokenId, expectedTokenManagerAddress, MINT_BURN, params); @@ -1020,7 +1015,7 @@ describe('Interchain Token Service', () => { ]); const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); - const tx = service.linkToken(salt, '', token.address, MINT_BURN_FROM, autoScaling, wallet.address, 0); + const tx = service.linkToken(salt, '', token.address, MINT_BURN_FROM, wallet.address, 0); const expectedTokenManagerAddress = await service.tokenManagerAddress(tokenId); await expect(tx) .to.emit(service, 'TokenManagerDeployed') @@ -1057,7 +1052,7 @@ describe('Interchain Token Service', () => { ]); const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); - const tx = service.linkToken(salt, '', token.address, LOCK_UNLOCK_FEE_ON_TRANSFER, autoScaling, wallet.address, 0); + const tx = service.linkToken(salt, '', token.address, LOCK_UNLOCK_FEE_ON_TRANSFER, wallet.address, 0); const expectedTokenManagerAddress = await service.tokenManagerAddress(tokenId); await expect(tx) .to.emit(service, 'TokenManagerDeployed') @@ -1085,7 +1080,7 @@ describe('Interchain Token Service', () => { await service.setPauseStatus(true).then((tx) => tx.wait); await expectRevert( - (gasOptions) => service.linkToken(salt, '', token.address, LOCK_UNLOCK, autoScaling, wallet.address, 0, gasOptions), + (gasOptions) => service.linkToken(salt, '', token.address, LOCK_UNLOCK, wallet.address, 0, gasOptions), service, 'Pause', ); @@ -1095,21 +1090,20 @@ describe('Interchain Token Service', () => { }); describe('Initialize remote custom token manager deployment', () => { - const autoScaling = false; it('Should initialize a remote custom token manager deployment', async () => { const salt = getRandomBytes32(); const tokenAddress = wallet.address; - await (await service.linkToken(salt, '', tokenAddress, MINT_BURN, autoScaling, '0x', 0)).wait(); + await (await service.linkToken(salt, '', tokenAddress, MINT_BURN, '0x', 0)).wait(); const tokenId = await service.interchainTokenId(wallet.address, salt); const remoteTokenAddress = '0x1234'; const minter = '0x5789'; const type = LOCK_UNLOCK; const payload = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, type, tokenAddress, remoteTokenAddress, autoScaling, minter], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, type, tokenAddress, remoteTokenAddress, minter], ); const tokenManager = await getContractAt('TokenManager', await service.deployedTokenManager(tokenId), wallet); @@ -1120,7 +1114,7 @@ describe('Interchain Token Service', () => { await expect( reportGas( - service.linkToken(salt, destinationChain, remoteTokenAddress, type, autoScaling, minter, gasValue, { value: gasValue }), + service.linkToken(salt, destinationChain, remoteTokenAddress, type, minter, gasValue, { value: gasValue }), 'Send deployTokenManager to remote chain', ), ) @@ -1133,7 +1127,6 @@ describe('Interchain Token Service', () => { tokenAddress.toLowerCase(), remoteTokenAddress.toLowerCase(), type, - autoScaling, minter.toLowerCase(), ) .and.to.emit(gasService, 'NativeGasPaidForContractCall') @@ -1147,11 +1140,10 @@ describe('Interchain Token Service', () => { const tokenId = await service.interchainTokenId(wallet.address, salt); const tokenAddress = '0x1234'; const minter = '0x5678'; - const autoScaling = true; const type = LOCK_UNLOCK; await expect( - service.linkToken(salt, destinationChain, tokenAddress, type, autoScaling, minter, gasValue, { value: gasValue }), + service.linkToken(salt, destinationChain, tokenAddress, type, minter, gasValue, { value: gasValue }), ).to.be.revertedWithCustomError(service, 'TokenManagerDoesNotExist', [tokenId]); }); @@ -1161,12 +1153,11 @@ describe('Interchain Token Service', () => { const salt = getRandomBytes32(); const tokenAddress = '0x1234'; const minter = '0x5678'; - const autoScaling = true; const type = LOCK_UNLOCK; await expectRevert( (gasOptions) => - service.linkToken(salt, destinationChain, tokenAddress, type, autoScaling, minter, gasValue, { + service.linkToken(salt, destinationChain, tokenAddress, type, minter, gasValue, { ...gasOptions, value: gasValue, }), @@ -1193,7 +1184,6 @@ describe('Interchain Token Service', () => { const tokenManagerAddress = await service.tokenManagerAddress(tokenId); const tokenManagerType = LOCK_UNLOCK; const sourceTokenAddress = '0x1234'; - const autoScaling = true; const minter = wallet.address; const token = await deployContract(wallet, 'TestInterchainTokenStandard', [ @@ -1206,8 +1196,8 @@ describe('Interchain Token Service', () => { const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); const payload = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, autoScaling, minter], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, minter], ); const commandId = await approveContractCall(gateway, sourceChain, sourceAddress, service.address, payload); const expectedTokenManagerAddress = await service.tokenManagerAddress(tokenId); @@ -1226,7 +1216,6 @@ describe('Interchain Token Service', () => { const tokenManagerAddress = await service.tokenManagerAddress(tokenId); const tokenManagerType = MINT_BURN; const sourceTokenAddress = '0x1234'; - const autoScaling = true; const minter = wallet.address; const token = await deployContract(wallet, 'TestInterchainTokenStandard', [ @@ -1239,8 +1228,8 @@ describe('Interchain Token Service', () => { const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); const payload = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, autoScaling, minter], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, minter], ); const commandId = await approveContractCall(gateway, sourceChain, sourceAddress, service.address, payload); @@ -1257,7 +1246,6 @@ describe('Interchain Token Service', () => { const tokenId = getRandomBytes32(); const tokenManagerType = NATIVE_INTERCHAIN_TOKEN; const sourceTokenAddress = '0x1234'; - const autoScaling = true; const minter = wallet.address; const token = await deployContract(wallet, 'TestInterchainTokenStandard', [ @@ -1269,8 +1257,8 @@ describe('Interchain Token Service', () => { ]); const payload = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, autoScaling, minter], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, tokenManagerType, sourceTokenAddress, token.address, minter], ); const commandId = await approveContractCall(gateway, sourceChain, sourceAddress, service.address, payload); @@ -1330,7 +1318,6 @@ describe('Interchain Token Service', () => { 'TT', 12, amount, - false, 'reentrant', ); @@ -2141,9 +2128,8 @@ describe('Interchain Token Service', () => { it('Should revert with NotSupported when the message type is RECEIVE_FROM_HUB and has MESSAGE_TYPE_DEPLOY_TOKEN_MANAGER type.', async () => { const salt = getRandomBytes32(); const tokenAddress = wallet.address; - const autoScaling = false; - await (await service.linkToken(salt, '', tokenAddress, MINT_BURN, autoScaling, wallet.address, 0)).wait(); + await (await service.linkToken(salt, '', tokenAddress, MINT_BURN, wallet.address, 0)).wait(); const tokenId = await service.interchainTokenId(wallet.address, salt); const remoteTokenAddress = '0x1234'; @@ -2151,8 +2137,8 @@ describe('Interchain Token Service', () => { const type = LOCK_UNLOCK; const sourceChain = 'hub chain 1'; const itsMessage = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, type, tokenAddress, remoteTokenAddress, autoScaling, minter], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, type, tokenAddress, remoteTokenAddress, minter], ); const payload = defaultAbiCoder.encode( ['uint256', 'string', 'bytes'], diff --git a/test/InterchainTokenServiceFullFlow.js b/test/InterchainTokenServiceFullFlow.js index 2722e5ce..3dbf4ac2 100644 --- a/test/InterchainTokenServiceFullFlow.js +++ b/test/InterchainTokenServiceFullFlow.js @@ -342,7 +342,6 @@ describe('Interchain Token Service Full Flow', () => { const gasValues = [1234, 5678]; const tokenCap = 1e9; const salt = keccak256('0x697858'); - const autoScaling = true; before(async () => { token = await deployContract(wallet, 'TestMintableBurnableERC20', [name, symbol, decimals]); @@ -356,7 +355,7 @@ describe('Interchain Token Service Full Flow', () => { const tokenManagerImplementation = await getContractAt('TokenManager', tokenManagerImplementationAddress, wallet); const params = await tokenManagerImplementation.params(wallet.address, token.address); - let tx = await service.populateTransaction.linkToken(salt, '', token.address, MINT_BURN, autoScaling, wallet.address, 0); + let tx = await service.populateTransaction.linkToken(salt, '', token.address, MINT_BURN, wallet.address, 0); const calls = [tx.data]; let value = 0; @@ -370,7 +369,6 @@ describe('Interchain Token Service Full Flow', () => { otherChains[i], remoteTokenAddress, MINT_BURN, - autoScaling, wallet.address, gasValues[i], ); @@ -379,8 +377,8 @@ describe('Interchain Token Service Full Flow', () => { } const payload = defaultAbiCoder.encode( - ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bool', 'bytes'], - [MESSAGE_TYPE_LINK_TOKEN, tokenId, MINT_BURN, token.address, token.address, autoScaling, wallet.address], + ['uint256', 'bytes32', 'uint256', 'bytes', 'bytes', 'bytes'], + [MESSAGE_TYPE_LINK_TOKEN, tokenId, MINT_BURN, token.address, token.address, wallet.address], ); const expectedTokenManagerAddress = await service.tokenManagerAddress(tokenId); @@ -394,7 +392,6 @@ describe('Interchain Token Service Full Flow', () => { token.address.toLowerCase(), token.address.toLowerCase(), MINT_BURN, - autoScaling, wallet.address.toLowerCase(), ) .and.to.emit(gasService, 'NativeGasPaidForContractCall') @@ -408,7 +405,6 @@ describe('Interchain Token Service Full Flow', () => { token.address.toLowerCase(), token.address.toLowerCase(), MINT_BURN, - autoScaling, wallet.address.toLowerCase(), ) .and.to.emit(gasService, 'NativeGasPaidForContractCall') diff --git a/test/InterchainTokenServiceUpgradeFlow.js b/test/InterchainTokenServiceUpgradeFlow.js index 670df9c3..69befd4e 100644 --- a/test/InterchainTokenServiceUpgradeFlow.js +++ b/test/InterchainTokenServiceUpgradeFlow.js @@ -52,7 +52,7 @@ describe('Interchain Token Service Upgrade Flow', () => { ]); const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, token.address]); - await expect(service.linkToken(salt, '', token.address, MINT_BURN, true, wallet.address, 0)) + await expect(service.linkToken(salt, '', token.address, MINT_BURN, wallet.address, 0)) .to.emit(service, 'TokenManagerDeployed') .withArgs(tokenId, tokenManager.address, MINT_BURN, params); }