Purpose
Each programmable address contract serves a single destination:- Token reception: Receives tokens from users
- Action execution: Converts deposits into cross-chain intents via Portal
- Refund handling: Returns funds for expired/unfulfilled intents
Functions
initialize
Called by the factory immediately after deployment._destinationAddress: Destination wallet that will receive funds_depositor: Address authorized to trigger refunds
createIntent
Creates a cross-chain intent for the specified amount.amount: Amount of tokens to include in the intent
intentHash: Unique identifier for the created intent
refund
Triggers a refund for an expired intent.routeHash: Hash of the route parametersreward: Reward structure for the intent
View Functions
Reward Structure
The refund function requires a Reward struct:| Field | Type | Description |
|---|---|---|
deadline | uint64 | Intent expiry timestamp |
creator | address | Intent creator (this contract) |
prover | address | Prover contract address |
nativeAmount | uint256 | Native token amount |
tokens | TokenAmount[] | Token amounts in reward |
Events
IntentCreated
| Field | Type | Indexed | Description |
|---|---|---|---|
intentHash | bytes32 | Yes | Unique intent identifier |
amount | uint256 | No | Token amount in the intent |
caller | address | Yes | Address that triggered intent creation |
IntentRefunded
| Field | Type | Indexed | Description |
|---|---|---|---|
routeHash | bytes32 | Yes | Route hash of the refunded intent |
refundee | address | Yes | Address receiving the refund |
Errors
AlreadyInitialized
initialize() is called more than once.
NotInitialized
OnlyFactory
initialize().
