How to use the @0x/sol-resolver.NameResolver function in @0x/sol-resolver

To help you get started, we’ve selected a few @0x/sol-resolver 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 / contracts-gen / src / contracts-gen.ts View on Github external
compilerJSON.contracts = _.map(contracts, contract => {
            if (contract.endsWith(SOLIDITY_EXTENSION)) {
                // If it's already a relative path - NO-OP.
                return contract;
            } else {
                // If it's just a contract name - resolve it and rewrite.
                return new NameResolver(contractsDir).resolve(contract).path;
            }
        });
        compilerJSON.contracts = _.sortBy(compilerJSON.contracts);
github 0xProject / 0x-monorepo / packages / sol-compiler / src / compiler.ts View on Github external
process.env.SOLCJS_PATH !== undefined
                ? getSolcJSVersionFromPath(process.env.SOLCJS_PATH)
                : passedOpts.solcVersion || config.solcVersion;
        this._compilerSettings = {
            ...DEFAULT_COMPILER_SETTINGS,
            ...config.compilerSettings,
            ...passedOpts.compilerSettings,
        };
        this._artifactsDir = passedOpts.artifactsDir || config.artifactsDir || DEFAULT_ARTIFACTS_DIR;
        this._specifiedContracts = passedOpts.contracts || config.contracts || ALL_CONTRACTS_IDENTIFIER;
        this._useDockerisedSolc =
            passedOpts.useDockerisedSolc || config.useDockerisedSolc || DEFAULT_USE_DOCKERISED_SOLC;
        this._isOfflineMode = passedOpts.isOfflineMode || config.isOfflineMode || DEFAULT_IS_OFFLINE_MODE;
        this._shouldSaveStandardInput =
            passedOpts.shouldSaveStandardInput || config.shouldSaveStandardInput || DEFAULT_SHOULD_SAVE_STANDARD_INPUT;
        this._nameResolver = new NameResolver(this._contractsDir);
        const resolver = new FallthroughResolver();
        resolver.appendResolver(new URLResolver());
        resolver.appendResolver(new NPMResolver(this._contractsDir));
        resolver.appendResolver(new RelativeFSResolver(this._contractsDir));
        resolver.appendResolver(new FSResolver());
        resolver.appendResolver(this._nameResolver);
        this._resolver = resolver;
    }
    /**

@0x/sol-resolver

Import resolver for smart contracts dependencies

Apache-2.0
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis