const fs = require('fs');
const web3 = require('web3');
const utils = web3.utils;
const contractsDirectory = './src/contracts';
const tokensDirectory = './src/tokens';
const nftsDirectory = './src/nfts';

function renameTokens() {
  fs.readdirSync(tokensDirectory).forEach(folder => {
    fs.readdirSync(`${tokensDirectory}/${folder}`).forEach(file => {
      if (!utils.checkAddressChecksum(file.replace('.json', ''))) {
        fs.renameSync(
          `${tokensDirectory}/${folder}/${file}`,
          `${tokensDirectory}/${folder}/${utils
            .toChecksumAddress(file.replace('.json', ''))
            .toLowerCase()}.json`
        );
      }
    });
  });
}

function renameNfts() {
  fs.readdirSync(nftsDirectory).forEach(folder => {
    fs.readdirSync(`${nftsDirectory}/${folder}`).forEach(file => {
      if (!utils.checkAddressChecksum(file.replace('.json', ''))) {
        fs.renameSync(
          `${nftsDirectory}/${folder}/${file}`,
          `${nftsDirectory}/${folder}/${utils
            .toChecksumAddress(file.replace('.json', ''))
            .toLowerCase()}.json`
        );
      }
    });
  });
}

function renameContracts() {
  fs.readdirSync(contractsDirectory).forEach(folder => {
    fs.readdirSync(`${contractsDirectory}/${folder}`).forEach(file => {
      if (!utils.checkAddressChecksum(file.replace('.json', ''))) {
        fs.renameSync(
          `${contractsDirectory}/${folder}/${file}`,
          `${contractsDirectory}/${folder}/${utils
            .toChecksumAddress(file.replace('.json', ''))
            .toLowerCase()}.json`
        );
      }
    });
  });
}

function renameToChecksum() {
  renameTokens();
  renameContracts();
  renameNfts();
}

module.exports = renameToChecksum;

@@ -597,43 +597,16 @@
 ''))
-%0A            .toLowerCase()
 %7D.json%60%0A
     
@@ -593,32 +593,32 @@
 n', ''))%7D.json%60%0A
+
         );%0A     
@@ -1026,35 +1026,8 @@
 ''))
-%0A            .toLowerCase()
 %7D.js
@@ -1411,32 +1411,32 @@
 folder%7D/$%7Butils%0A
+
             .toC
@@ -1480,35 +1480,8 @@
 ''))
-%0A            .toLowerCase()
 %7D.js

Fix compile issue