Add more types

pull/2260/head
David Disu 2 years ago
parent d6b711a7f5
commit c13f5b0a47
  1. 7
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  2. 17
      libs/remix-core-plugin/src/types/contract.ts
  3. 1
      libs/remix-ui/run-tab/src/index.ts

@ -1,6 +1,5 @@
import { DeployOption } from '@remix-ui/run-tab';
import { Plugin } from '@remixproject/engine';
import { ContractABI, ContractAST } from '../types/contract';
import { ContractABI, ContractAST, DeployOption } from '../types/contract';
import { UUPS, UUPSABI, UUPSBytecode, UUPSfunAbi } from './constants/uups';
const proxyProfile = {
@ -48,7 +47,7 @@ export class OpenZeppelinProxy extends Plugin {
return inputs
}
async execute(implAddress: string, args: string | string [] = '', initializeABI, implementationContractObject) {
async execute(implAddress: string, args: string | string [] = '', initializeABI, implementationContractObject): Promise<void> {
// deploy the proxy, or use an existing one
if (!initializeABI) throw new Error('Cannot deploy proxy: Missing initialize ABI')
args = args === '' ? [] : args
@ -57,7 +56,7 @@ export class OpenZeppelinProxy extends Plugin {
if (this.kind === 'UUPS') this.deployUUPSProxy(implAddress, _data, implementationContractObject)
}
async deployUUPSProxy (implAddress: string, _data: string, implementationContractObject) {
async deployUUPSProxy (implAddress: string, _data: string, implementationContractObject): Promise<void> {
const args = [implAddress, _data]
const constructorData = await this.blockchain.getEncodedParams(args, UUPSfunAbi)
const proxyName = 'ERC1967Proxy'

@ -135,3 +135,20 @@ export interface ContractABI {
};
};
}
export type DeployOption = {
initializeInputs: string,
inputs: {
inputs: {
internalType?: string,
name: string,
type: string
}[],
name: "initialize",
outputs?: any[],
stateMutability: string,
type: string,
payable?: boolean,
constant?: any
}
}

@ -1,2 +1 @@
export * from './lib/run-tab'
export * from './lib/types'

Loading…
Cancel
Save