Skip to content

Commit 4700ce6

Browse files
committed
Check if any of entrypoints is called exactly eu_recv_packet
1 parent aea2a1c commit 4700ce6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/api/lib.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os"
1111
"path/filepath"
1212
"runtime"
13+
"slices"
1314
"strings"
1415
"syscall"
1516

@@ -162,13 +163,14 @@ func AnalyzeCode(cache Cache, checksum []byte) (*types.AnalysisReport, error) {
162163
}
163164
requiredCapabilities := string(copyAndDestroyUnmanagedVector(report.required_capabilities))
164165
entrypoints := string(copyAndDestroyUnmanagedVector(report.entrypoints))
165-
hasEurekaEntryPoints := strings.Contains(entrypoints, "eu_recv_packet")
166+
entrypoints_array := strings.Split(entrypoints, ",")
167+
hasEurekaEntryPoints := slices.Contains(entrypoints_array, "eu_recv_packet")
166168

167169
res := types.AnalysisReport{
168170
HasIBCEntryPoints: bool(report.has_ibc_entry_points),
169171
HasEurekaEntryPoints: hasEurekaEntryPoints,
170172
RequiredCapabilities: requiredCapabilities,
171-
Entrypoints: strings.Split(entrypoints, ","),
173+
Entrypoints: entrypoints_array,
172174
ContractMigrateVersion: optionalU64ToPtr(report.contract_migrate_version),
173175
}
174176
return &res, nil

0 commit comments

Comments
 (0)