Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Add addresses to contract artifacts #1256

Closed

Conversation

abandeali1
Copy link
Member

Description

This change is a prerequisite to updating how our migrations work, since we will need to modify and read from the contract artifacts directly.

Testing instructions

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Prefix PR title with bracketed package name(s) corresponding to the changed package(s). For example: [sol-cov] Fixed bug.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@@ -19,34 +30,34 @@ export enum NetworkId {

const networkToAddresses: { [networkId: number]: ContractAddresses } = {
1: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be cleaned up by just iterating through the enum and building the object. Or is there something else upcoming planned which would prevent this?

[1, 3, 42].reduce((acc, i) => {
    return {
        ...acc,
        [i]: {
            erc20Proxy: (ERC20Proxy as ContractArtifact).networks[i].address,
            erc721Proxy: (ERC721Proxy as ContractArtifact).networks[i].address,
            zrxToken: (ZRXToken as ContractArtifact).networks[i].address,
            etherToken: (WETH9 as ContractArtifact).networks[i].address,
            exchange: (Exchange as ContractArtifact).networks[i].address,
            assetProxyOwner: (AssetProxyOwner as ContractArtifact).networks[i].address,
            forwarder: (Forwarder as ContractArtifact).networks[i].address,
            orderValidator: (OrderValidator as ContractArtifact).networks[i].address,
        },
    };
}, {});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants