Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Erroneous output when recompiling a contract #37

@andrew-fleming

Description

@andrew-fleming

Recompiling a contract with altered code will sometimes return an invalid json. This occurs when a variable is removed in an already-compiled contract.

Steps to reproduce

#[contract]
mod Contract {
    #[external]
    fn foo() {
        let bar = 5;
    }
}
  1. Compile the contract above

  2. Remove/comment out the bar variable and compile again and look the the json output. This is appended to the end of the object:

}a0649752af1b28b3dc29a1556eee781e4a4c3a1f7f53f90fa834de098c4d",
        "function_idx": 0
      }
    ],
    "L1_HANDLER": [],
    "CONSTRUCTOR": []
  },
  "abi": [
    {
      "type": "function",
      "name": "foo",
      "inputs": [],
      "outputs": [],
      "state_mutability": "external"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions