public static object Main(string operation, params object[] args) { if (Runtime.Trigger == TriggerType.Verification) { if (ContractOwner.Length == 20) { // if param ContractOwner is script hash //return Runtime.CheckWitness(ContractOwner); return(false); } else if (ContractOwner.Length == 33) { // if param ContractOwner is public key byte[] signature = operation.AsByteArray(); return(VerifySignature(signature, ContractOwner)); } } else if (Runtime.Trigger == TriggerType.VerificationR) { return(true); } else if (Runtime.Trigger == TriggerType.Application) { var result = AdminOperations.HandleAdminOperation(operation, args); if (result.IsComplete) { return(result.Value); } result = NepOperations.HandleNepOperation(operation, args); if (result.IsComplete) { return(result.Value); } result = TokenOperations.HandleTokenOperation(operation, args); if (result.IsComplete) { return(result.Value); } result = GameOperations.HandleGameOperation(operation, args); if (result.IsComplete) { return(result.Value); } } return(false); }
public static object Main(string operation, params object[] args) { if (Runtime.Trigger == TriggerType.Verification) { if (ContractOwner.Length == 20) { return(false); } else if (ContractOwner.Length == 33) { byte[] signature = operation.AsByteArray(); return(VerifySignature(signature, ContractOwner)); } } else if (Runtime.Trigger == TriggerType.VerificationR) { return(true); } else if (Runtime.Trigger == TriggerType.Application) { var result = AdminOperations.HandleAdminOperation(operation, args); if (result.IsComplete) { return(result.Value); } result = NepOperations.HandleNepOperation(operation, args); if (result.IsComplete) { return(result.Value); } result = MarketOperations.HandleMarketOperation(operation, args); if (result.IsComplete) { return(result.Value); } } return(false); }