# Function forArtifact

- forArtifact(artifact, settings?): Promise<ContractEncoder>

- This function is asynchronous.

  Constructs a contract encoder for a given contract artifact.

  #### Parameters

  - ##### artifact: ContractObject

    The artifact for the contract.

    A contract constructor object may be substituted for the artifact, so if you're not sure which you're dealing with, it's OK.

  - ##### settings: EncoderSettings = {}

    The [[EncoderSettings]] to use; see the documentation for that type for more information. If absent, the encoder will be based on just the single contract provided; it is recommended to pass more information to get the encoder's full power.

    Note that if the artifact contains unlinked libraries, you will have to pass either the `provider` or `networkId` setting in order to encode contract creation transactions.

  #### Returns Promise<ContractEncoder>

  - Defined in encoder/lib/index.ts:233

Generated using TypeDoc