@pushchain/core 5.1.4-alpha.5 → 5.1.4-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushchain/core",
3
- "version": "5.1.4-alpha.5",
3
+ "version": "5.1.4-alpha.6",
4
4
  "homepage": "https://push.org",
5
5
  "keywords": [
6
6
  "pushchain",
@@ -283,12 +283,15 @@ function executeUoaToCea(ctx, params, executeFn) {
283
283
  const EVM_GAS_RESERVE = BigInt(3e18); // 3 UPC for tx overhead
284
284
  // Reuse ueaBalance fetched earlier (line 383) — no tx sent between, balance is stable
285
285
  const currentBalance = ueaBalance;
286
+ // Balance-aware adjustment — same logic whether UEA is deployed or not.
287
+ // The old !isUEADeployed branch blindly used 200 UPC assuming fee-locking
288
+ // would deposit enough, but the actual deposit depends on origin-chain ETH
289
+ // locked — not a guaranteed 200 UPC. This caused executeUniversalTx to
290
+ // revert when UEA balance < 200 UPC. The contract's swapAndBurnGas does
291
+ // exactOutputSingle and refunds excess PC, so overshooting within balance
292
+ // is safe.
286
293
  let adjustedValue;
287
- if (!isUEADeployed) {
288
- // UEA not yet deployed — fee-locking will deposit funds; use target value, excess is refunded
289
- adjustedValue = nativeValueForGas > BigInt(0) ? EVM_NATIVE_VALUE_TARGET : nativeValueForGas;
290
- }
291
- else if (currentBalance > EVM_NATIVE_VALUE_TARGET + EVM_GAS_RESERVE) {
294
+ if (currentBalance > EVM_NATIVE_VALUE_TARGET + EVM_GAS_RESERVE) {
292
295
  // Enough balance: use 200 UPC target
293
296
  adjustedValue = EVM_NATIVE_VALUE_TARGET;
294
297
  }