Skip to content

Commit 7d9fe13

Browse files
author
Sergio
authored
Merge pull request #106 from rsksmart/feat/upgradeable-erc20-erc1967
Feat/upgradeable erc20 erc1967
2 parents e0f3dd7 + 84dd3a1 commit 7d9fe13

File tree

5 files changed

+1000
-2456
lines changed

5 files changed

+1000
-2456
lines changed

dist/services/classes/Contract.js

+13
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ class Contract extends _BcThing.BcThing {
3535
if (!deployedCode) throw new Error(`Missing deployed code for contract: ${this.address}`);
3636
let info = await this.parser.getContractInfo(deployedCode, contract);
3737
let { interfaces, methods } = info;
38+
39+
if (!interfaces.length) {// if no interfaces... double check
40+
const proxyCheckResult = await this.parser.getEIP1967Info(this.address);
41+
// if proxy detected, the implementation contract interfaces are used
42+
if (proxyCheckResult && proxyCheckResult.interfaces.length) {
43+
interfaces = proxyCheckResult.interfaces;
44+
}
45+
46+
if (proxyCheckResult && proxyCheckResult.methods.length) {
47+
methods = proxyCheckResult.methods;
48+
}
49+
};
50+
3851
if (interfaces.length) this.setData({ contractInterfaces: interfaces });
3952
if (methods) this.setData({ contractMethods: methods });
4053
}

0 commit comments

Comments
 (0)