How to use the ethereum-types.AbiType.Constructor function in ethereum-types

To help you get started, we’ve selected a few ethereum-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / base-contract / src / index.ts View on Github external
protected static _lookupConstructorAbi(abi: ContractAbi): ConstructorAbi {
        const constructorAbiIfExists = _.find(
            abi,
            (abiDefinition: AbiDefinition) => abiDefinition.type === AbiType.Constructor,
            // tslint:disable-next-line:no-unnecessary-type-assertion
        ) as ConstructorAbi | undefined;
        if (constructorAbiIfExists !== undefined) {
            return constructorAbiIfExists;
        } else {
            // If the constructor is not explicitly defined, it won't be included in the ABI. It is
            // still callable however, so we construct what the ABI would look like were it to exist.
            const defaultConstructorAbi: ConstructorAbi = {
                type: AbiType.Constructor,
                stateMutability: 'nonpayable',
                payable: false,
                inputs: [],
            };
            return defaultConstructorAbi;
        }
    }
    protected static async _applyDefaultsToTxDataAsync>(
github 0xProject / 0x-monorepo / packages / base-contract / src / index.ts View on Github external
            (abiDefinition: AbiDefinition) => abiDefinition.type === AbiType.Constructor,
            // tslint:disable-next-line:no-unnecessary-type-assertion
github 0xProject / 0x-monorepo / packages / abi-gen / src / utils.ts View on Github external
getEmptyConstructor(): ConstructorAbi {
        return {
            type: AbiType.Constructor,
            stateMutability: 'nonpayable',
            payable: false,
            inputs: [],
        };
    },
};
github 0xProject / 0x-monorepo / packages / abi-gen / src / utils.ts View on Github external
getEmptyConstructor(): ConstructorAbi {
        return {
            type: AbiType.Constructor,
            stateMutability: 'nonpayable',
            payable: false,
            inputs: [],
        };
    },
    makeOutputFileName(name: string): string {
github 0xProject / 0x-monorepo / packages / sol-compiler / src / utils / encoder.ts View on Github external
_.each(abi, (element: AbiDefinition) => {
            if (element.type === AbiType.Constructor) {
                _.each(element.inputs, (input: DataItem) => {
                    constructorTypes.push(input.type);
                });
            }
        });
        const encodedParameters = web3Abi.encodeParameters(constructorTypes, args);