Define contracts abi type

pull/5370/head
David Disu 3 years ago
parent 8d3e41fe09
commit 3c2655ba53
  1. 89
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  2. 84
      libs/remix-core-plugin/src/types/contract.ts
  3. 1
      libs/remix-ui/run-tab/src/lib/actions/index.ts

File diff suppressed because one or more lines are too long

@ -52,4 +52,86 @@ export interface ContractAST {
name?: string,
usedErrors?: any[]
}[]
}
}
export interface ContractABI {
[key: string]: {
abi: ({
inputs: never[];
stateMutability: string;
type: string;
anonymous?: undefined;
name?: undefined;
outputs?: undefined;
} | {
anonymous: boolean;
inputs: {
indexed: boolean;
internalType: string;
name: string;
type: string;
}[];
name: string;
type: string;
stateMutability?: undefined;
outputs?: undefined;
} | {
inputs: {
internalType: string;
name: string;
type: string;
}[];
name: string;
outputs: {
internalType: string;
name: string;
type: string;
}[];
stateMutability: string;
type: string;
anonymous?: undefined;
})[];
devdoc: {
kind: string;
methods: {
[key: string]: {
[key: string]: string
}
};
version: number;
};
evm: any
metadata: string;
storageLayout: {
storage: {
astId: number;
contract: string;
label: string;
offset: number;
slot: string;
type: string;
}[];
types: {
[key: string]: {
base: string;
encoding: string;
label: string;
numberOfBytes: string;
members?: {
astId: number;
contract: string;
label: string;
offset: number;
slot: string;
type: string;
}[];
};
};
};
userdoc: {
kind: string;
methods: any;
version: number;
};
};
}

@ -298,6 +298,7 @@ const broadcastCompilationResult = async (file, source, languageVersion, data, i
return { name: languageVersion, alias: contract.name, file: contract.file, compiler }
})
const isUpgradeable = await plugin.call('openzeppelin-proxy', 'isConcerned', data.sources[file].ast)
console.log('data: ', data)
if (isUpgradeable) dispatch(setDeployOptions([{ title: 'Deploy with Proxy', active: false }]))
else dispatch(setDeployOptions([]))

Loading…
Cancel
Save