import fs from "fs" ; const removeFunctionsFromABI = ( contractJsonPath , removalCondition ) => { const rawdata = fs . readFileSync ( contractJsonPath ) ; let contractJson = JSON . parse ( rawdata ) ; const { abi } = contractJson ; const toRemove = ( json ) => { const isFunction = json . type === "function" ; return isFunction && removalCondition ( json ) ; } ; const abiAfterRemovals = abi . filter ( ( json ) => ! toRemove ( json ) ) ; contractJson = { ... contractJson , abi : abiAfterRemovals } ; const data = JSON . stringify ( contractJson , null , 2 ) ; fs . writeFileSync ( contractJsonPath , data ) ; } ; const removeFromEstateRegistry = ( ) => { const filePath = "../land/build/contracts/EstateRegistry.json" ; const removalCondition = ( f ) => { return f . name === "initialize" && f . inputs . length != 3 ; } ; removeFunctionsFromABI ( filePath , removalCondition ) ; } ; const removeFromMarketplace = ( ) => { const filePath = "../marketplace-contracts/build/contracts/Marketplace.json" ; const removalCondition = ( f ) => { return f . name === "initialize" && f . inputs . length != 3 ; } ; removeFunctionsFromABI ( filePath , removalCondition ) ; } ;