From 95ac8e2f38599e6440fe511f61b07bdb311380fa Mon Sep 17 00:00:00 2001 From: lauraaruon-cyber Date: Wed, 19 Aug 2026 00:11:36 +0700 Subject: [PATCH] fix: prevent ETH lock in buildWithCast --- contracts/registry/index.sol | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/registry/index.sol b/contracts/registry/index.sol index 7f7ae31..fb24dd7 100644 --- a/contracts/registry/index.sol +++ b/contracts/registry/index.sol @@ -158,7 +158,11 @@ contract InstaIndex is CloneFactory { address _origin ) external payable returns (address _account) { _account = build(_owner, accountVersion, _origin); - if (_targets.length > 0) AccountInterface(_account).cast{value: msg.value}(_targets, _datas, _origin); + if (_targets.length > 0) { + AccountInterface(_account).cast{value: msg.value}(_targets, _datas, _origin); + } else { + require(msg.value == 0, "no-targets"); + } } /**