From 826c0b3c279b0c4483317591a19ab4bf098c082c Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Thu, 21 Mar 2024 04:38:30 -0400 Subject: [PATCH] add InterchainToken bytecode check --- test/InterchainToken.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/InterchainToken.js b/test/InterchainToken.js index 5ae6961a..716ebb11 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.only('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); + }); + }); });