public static void PolicyCall() { OnNotify(Policy.Name()); OnNotify(Policy.GetMaxTransactionsPerBlock()); OnNotify(Policy.GetMaxBlockSize()); OnNotify(Policy.GetMaxBlockSystemFee()); OnNotify(Policy.GetFeePerByte()); OnNotify(Policy.Hash); OnNotify(Policy.IsBlocked(Owner)); OnNotify(Policy.BlockAccount((UInt160)Owner)); OnNotify(Policy.UnblockAccount((UInt160)Owner)); }
private void Destroy(ApplicationEngine engine) { UInt160 hash = engine.CallingScriptHash; StorageKey ckey = CreateStorageKey(Prefix_Contract).Add(hash); ContractState contract = engine.Snapshot.TryGet(ckey)?.GetInteroperable <ContractState>(); if (contract is null) { return; } engine.Snapshot.Delete(ckey); foreach (var(key, _) in engine.Snapshot.Find(StorageKey.CreateSearchPrefix(contract.Id, ReadOnlySpan <byte> .Empty))) { engine.Snapshot.Delete(key); } // lock contract Policy.BlockAccount(engine.Snapshot, hash); // emit event engine.SendNotification(Hash, "Destroy", new VM.Types.Array(engine.ReferenceCounter) { hash.ToArray() }); }