You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Calls `onZkgm(path, sourceChannel, destChannel, sender, calldata)` on target
288
280
- Returns success acknowledgement immediately
289
281
- Fire-and-forget style, no callback to sender
282
+
-**ProxyAccount Auto-Creation**: If the target address matches a predictable ProxyAccount address derived from the sender, path, and channel, the ProxyAccount is automatically created before the call is executed
290
283
291
284
2. IBC Mode (eureka = true):
292
285
- Calls `onRecvPacket(packet, relayer, relayerMsg)` on target
@@ -298,6 +291,64 @@ If the target contract is invalid or calls fail:
298
291
- Standard mode returns failure acknowledgement
299
292
- IBC mode propagates target's error response
300
293
294
+
#### ProxyAccount
295
+
296
+
ProxyAccount is a smart contract wallet that enables cross-chain account abstraction. It allows users to control accounts on remote chains through the ZKGM protocol.
297
+
298
+
**Key Features:**
299
+
-**Deterministic Addresses**: ProxyAccount addresses are derived deterministically from the sender address, channel ID and path, ensuring the same sender always gets the same ProxyAccount address
300
+
-**Auto-Creation**: When a Call instruction targets a ProxyAccount address that doesn't exist yet, the protocol automatically deploys it before executing the call
301
+
-**Multi-Admin Support**: Supports both local admins (on the same chain) and remote admins (on other chains)
302
+
-**Upgradeable**: Implements UUPS pattern for upgradeability on EVM
303
+
-**Multicall Support**: Can execute multiple calls in a single transaction
304
+
305
+
**Address Prediction:**
306
+
```solidity
307
+
function predictProxyAccount(
308
+
uint256 path,
309
+
uint32 channel,
310
+
bytes calldata sender
311
+
) external returns (address, bytes32);
312
+
```
313
+
314
+
The ProxyAccount address is computed as:
315
+
1. Salt = `keccak256(abi.encode(path, channelId, sender))`
- Own and control accounts on any chain without deploying contracts in advance
348
+
- Execute arbitrary transactions on remote chains
349
+
- Manage assets and interact with DeFi protocols cross-chain
350
+
- Maintain consistent account addresses across deployments
351
+
301
352
:::tip
302
353
Example of a contract implementing `IZkgmable`:
303
354
```solidity
@@ -365,13 +416,13 @@ struct Batch {
365
416
366
417
Fields:
367
418
-`instructions`: Array of [Instructions](#instruction) to execute atomically
368
-
- Only specific instructions allowed (Call, TokenOrder, Stake, Unstake, WithdrawStake)
419
+
- Only specific instructions allowed (Call, TokenOrder)
369
420
- Executed in sequential order
370
421
- All must succeed or entire batch reverts
371
422
- Individual acknowledgements collected in array
372
423
- Minimum 2 instructions required
373
424
374
-
This allows atomic composition of transfers, contract calls, and staking operations in a single transaction.
425
+
This allows atomic composition of transfersand contract calls in a single transaction.
375
426
376
427
<Mermaid
377
428
content={`
@@ -385,7 +436,7 @@ sequenceDiagram
385
436
386
437
:::tip
387
438
388
-
In combination with forward envelopes or multiplexing, this batching mechanism is very useful to call contract before/after message execution (transfer an asset, swap it then stake the final asset).
439
+
In combination with forward envelopes, this batching mechanism is very useful to call contract before/after message execution (transfer an asset, swap it, then execute another operation with the final asset).
389
440
390
441
:::
391
442
@@ -962,159 +1013,6 @@ If any of the order in the `orders` list is failing on execution, the whole pack
962
1013
963
1014
:::
964
1015
965
-
### 0x04 - Stake
966
-
967
-
The stake instruction uses opcode `0x04` and requires version `INSTR_VERSION_0`.
968
-
969
-
```solidity
970
-
struct Stake {
971
-
uint256 tokenId; // NFT token ID for the staking position
0 commit comments