From 494ac7000e9e8a36f26dc99cd9525ac058a2942f Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 14 Mar 2024 19:30:53 +0530 Subject: [PATCH] fix pinning for contract deployed using scripts --- apps/remix-ide/src/app/tabs/web3-provider.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/web3-provider.js b/apps/remix-ide/src/app/tabs/web3-provider.js index d4efb04a77..41bd9d3c27 100644 --- a/apps/remix-ide/src/app/tabs/web3-provider.js +++ b/apps/remix-ide/src/app/tabs/web3-provider.js @@ -58,8 +58,17 @@ export class Web3ProviderModule extends Plugin { const contractAddressStr = addressToString(receipt.contractAddress) const contractData = await this.call('compilerArtefacts', 'getContractDataFromAddress', contractAddressStr) if (contractData) { - this.call('udapp', 'addInstance', contractAddressStr, contractData.contract.abi, contractData.name) const data = await this.call('compilerArtefacts', 'getCompilerAbstract', contractData.file) + const contractObject = { + name: contractData.name, + abi: contractData.contract.abi, + compiler: data, + contract: { + file : contractData.file, + object: contractData.contract + } + } + this.call('udapp', 'addInstance', contractAddressStr, contractData.contract.abi, contractData.name, contractObject) await this.call('compilerArtefacts', 'addResolvedContract', contractAddressStr, data) } }, 50)