Skip to content

Commit

Permalink
feat(abi-fetcher): support implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
KABBOUCHI committed Nov 22, 2022
1 parent b333bca commit 2e5dad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instadapp/utils",
"version": "0.4.4",
"version": "0.4.5",
"description": "",
"repository": "instadapp/utils",
"license": "MIT",
Expand Down
6 changes: 6 additions & 0 deletions src/abi/fetcher/AbiFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ export class AbiFetcher {
implementationAddress = await contract.getDummyImplementation()
implementationAbi = await this._get(implementationAddress, network, metadata)
return proxyFetchMode === 'implementationOnly' ? implementationAbi : [...originalAbi, ...implementationAbi]
} else if (originalAbi.some(item => item.type === 'function' && item.name === 'implementations')) {
const contract = new Contract(contractAddress, originalAbi, provider)

implementationAddress = await contract.implementations()
implementationAbi = await this._get(implementationAddress, network, metadata)
return proxyFetchMode === 'implementationOnly' ? implementationAbi : [...originalAbi, ...implementationAbi]
} else if (originalAbi.some(item => item.type === 'function' && item.name === 'comptrollerImplementation')) {
const contract = new Contract(contractAddress, originalAbi, provider)

Expand Down

0 comments on commit 2e5dad3

Please sign in to comment.