public static bool VerifyToken(string operation, object[] token) { byte[] address = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 }; VerifyTokenParam param = new VerifyTokenParam { }; param.ContractAddr = ExecutionEngine.ExecutingScriptHash; param.Fn = operation; param.Caller = (byte[])token[0]; param.KeyNo = (int)token[1]; byte[] ret = Native.Invoke(0, address, "verifyToken", param); return(ret[0] == 1); }
public static bool VerifyToken(string operation, object[] token) { byte[] address = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 }; VerifyTokenParam param = new VerifyTokenParam { }; byte[] con_add = { 0x31, 0x32, 0x33 }; param.ContractAddr = con_add; param.Fn = operation; param.Caller = (byte[])token[0]; param.KeyNo = (int)token[1]; byte[] ret = Native.Invoke(0, address, "verifyToken", param); return(ret[0] == 1); }
public static bool VerifyToken(string operation, object[] token) { byte[] address = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 }; VerifyTokenParam param = new VerifyTokenParam { }; byte[] con_add = { 0xd6, 0x2f, 0x66, 0x0a, 0xc4, 0xed, 0xb2, 0x94, 0xcf, 0xf0, 0xa3, 0x02, 0xe5, 0xc6, 0x23, 0x6d, 0xe5, 0x81, 0x53, 0x57 }; param.ContractAddr = con_add; param.Fn = operation; param.Caller = (byte[])token[0]; param.KeyNo = (int)token[1]; byte[] ret = Native.Invoke(0, address, "verifyToken", param); return(ret[0] == 1); }
public static bool VerifyToken(string operation, object[] token) { //must specify native contract's address in function scope byte[] authContractAddr = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 }; VerifyTokenParam param = new VerifyTokenParam { }; param.contractAddr = ExecutionEngine.ExecutingScriptHash; param.fn = operation; param.caller = (byte[])token[0]; param.keyNo = (int)token[1]; byte[] ret = Native.Invoke(0, authContractAddr, "verifyToken", param); return(ret[0] == 1); }