public override bool Visit(FunctionCall node) { if (FunctionCallHelper.IsLowLevelCall(node) || FunctionCallHelper.isDelegateCall(node)) { worklist.Clear(); foreach (FunctionDefinition def in context.FunctionToContractMap.Keys) { fnDeps.Add(def); } } else if (isBuiltinFn(node)) { return(true); } else { string fnName = TransUtils.GetFuncNameFromFuncCall(node); if (nameToFn.ContainsKey(fnName)) { foreach (FunctionDefinition fnDef in nameToFn[fnName]) { if (!seenFns.Contains(fnDef)) { worklist.AddLast(fnDef); seenFns.Add(fnDef); } } } } return(true); }
public static bool isSend(FunctionCall node) { var functionName = TransUtils.GetFuncNameFromFuncCall(node); return(functionName.Equals("send")); }
public static bool isDelegateCall(FunctionCall node) { var functionName = TransUtils.GetFuncNameFromFuncCall(node); return(functionName.Equals("delegatecall")); }
public static bool IsLowLevelCall(FunctionCall node) { var functionName = TransUtils.GetFuncNameFromFuncCall(node); return(functionName.Equals("call")); }
public static bool IsRevert(FunctionCall node) { var functionName = TransUtils.GetFuncNameFromFuncCall(node); return(functionName.Equals("revert")); }
private bool isBuiltinFn(FunctionCall call) { return(FunctionCallHelper.IsLowLevelCall(call) || FunctionCallHelper.isSend(call) || FunctionCallHelper.IsAssert(call) || FunctionCallHelper.isDelegateCall(call) || FunctionCallHelper.IsRequire(call) || FunctionCallHelper.IsRevert(call) || FunctionCallHelper.IsKeccakFunc(call) || FunctionCallHelper.IsAbiEncodePackedFunc(call) || FunctionCallHelper.IsTypeCast(call) || FunctionCallHelper.IsBuiltInTransferFunc(TransUtils.GetFuncNameFromFuncCall(call), call)); }