Skip to content

Found bug in Contract_Update/Contract_Destroy #1482

@Tommo-L

Description

@Tommo-L

Describe the bug

if (!contract.Manifest.IsValid(contract.ScriptHash)) return false;
if (!contract.HasStorage && engine.Snapshot.Storages.Find(engine.CurrentScriptHash.ToArray()).Any()) return false;

engine.Snapshot.Contracts.Delete(hash);
if (contract.HasStorage)
foreach (var (key, _) in engine.Snapshot.Storages.Find(hash.ToArray()))
engine.Snapshot.Storages.Delete(key);

Since we use contract.id as prefix key, it should replace here in contract.update and contract.destory.

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