Last modified: 2024-09-14
ContractManagement.GetContract Method
Gets the contract information.
Namespace: Neo.SmartContract.Framework.Native
Assembly: Neo.SmartContract.Framework
Syntax
public static extern Contract GetContract(UInt160 hash);
Parameters:
-
hash: the contract hash
Example
public class Contract1 : SmartContract.Framework.SmartContract
{
private static UInt160 ScriptHash = "NXsG3zwpwcfvBiA3bNMx6mWZGEro9ZqTqM".ToScriptHash();
public static object GetContract()
{
Contract contract = ContractManagement.GetContract(ScriptHash);
return contract != null;
}
}
Response body:
[{
"type":"Boolean",
"value":true
}]
Response description:
-
Boolean type: true indicates the contract has been deployed.
-
Other: failed.