diff --git a/contracts/InterchainTokenFactory.sol b/contracts/InterchainTokenFactory.sol index a5b90129..1d3209fc 100644 --- a/contracts/InterchainTokenFactory.sol +++ b/contracts/InterchainTokenFactory.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.0; import { AddressBytes } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressBytes.sol'; -import { SafeTokenTransfer, SafeTokenTransferFrom, SafeTokenCall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol'; import { Multicall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Multicall.sol'; import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol'; import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol'; @@ -19,11 +18,7 @@ import { IInterchainToken } from './interfaces/IInterchainToken.sol'; * @notice This contract is responsible for deploying new interchain tokens and managing their token managers. */ contract InterchainTokenFactory is IInterchainTokenFactory, ITokenManagerType, Multicall, Upgradable { - using AddressBytes for bytes; using AddressBytes for address; - using SafeTokenTransfer for IInterchainToken; - using SafeTokenTransferFrom for IInterchainToken; - using SafeTokenCall for IInterchainToken; IInterchainTokenService public immutable interchainTokenService; bytes32 public immutable chainNameHash; diff --git a/contracts/InterchainTokenService.sol b/contracts/InterchainTokenService.sol index a0e41ac5..e018b8f8 100644 --- a/contracts/InterchainTokenService.sol +++ b/contracts/InterchainTokenService.sol @@ -8,9 +8,7 @@ import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contract import { ExpressExecutorTracker } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/express/ExpressExecutorTracker.sol'; import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol'; import { Create3Address } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/deploy/Create3Address.sol'; -import { SafeTokenTransferFrom, SafeTokenCall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol'; import { AddressBytes } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressBytes.sol'; -import { StringToBytes32, Bytes32ToString } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/Bytes32String.sol'; import { Multicall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Multicall.sol'; import { Pausable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Pausable.sol'; import { InterchainAddressTracker } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/InterchainAddressTracker.sol'; @@ -44,12 +42,8 @@ contract InterchainTokenService is InterchainAddressTracker, IInterchainTokenService { - using StringToBytes32 for string; - using Bytes32ToString for bytes32; using AddressBytes for bytes; using AddressBytes for address; - using SafeTokenTransferFrom for IERC20; - using SafeTokenCall for IERC20; IAxelarGateway public immutable gateway; IAxelarGasService public immutable gasService; diff --git a/test/InterchainToken.js b/test/InterchainToken.js index 5ae6961a..a7ff687a 100644 --- a/test/InterchainToken.js +++ b/test/InterchainToken.js @@ -4,9 +4,10 @@ const { ethers } = require('hardhat'); const { constants: { AddressZero, HashZero, MaxUint256 }, getContractAt, + utils: { keccak256 }, } = ethers; const { expect } = require('chai'); -const { getRandomBytes32, expectRevert } = require('./utils'); +const { getRandomBytes32, expectRevert, getEVMVersion } = require('./utils'); const { deployContract } = require('../scripts/deploy'); describe('InterchainToken', () => { @@ -138,4 +139,18 @@ describe('InterchainToken', () => { expect(finalAllowance).to.eq(initialAllowance); }); }); + + describe('Bytecode checks [ @skip-on-coverage ]', () => { + it('Should preserve the same bytecode', async () => { + const contract = await ethers.getContractFactory('InterchainToken', owner); + const contractBytecode = contract.bytecode; + const contractBytecodeHash = keccak256(contractBytecode); + + const expected = { + london: '0xa01cf28b0b6ce6dc3b466e995585d69486400d671fce0ea8d06beba583e6f3bb', + }[getEVMVersion()]; + + expect(contractBytecodeHash).to.be.equal(expected); + }); + }); });