Skip to main content
The Address Factory is a smart contract that generates deterministic programmable addresses and deploys their contracts on demand. Each factory is configured for a specific source-destination token pair.

Purpose

The factory serves as the entry point for the programmable address system:
  • Address generation: Computes programmable addresses without onchain transactions
  • Contract deployment: Deploys programmable address contracts when funds are received
  • Configuration storage: Holds immutable settings for all programmable address contracts it creates

Constructor

Functions

getDepositAddress

Computes the deterministic programmable address for a given destination.
Parameters:
  • destinationAddress: destination wallet address as bytes32 (cross-VM compatible)
Returns:
  • The EVM address where the user should send tokens

isDeployed

Checks if a programmable address contract has been deployed for a destination.

deploy

Deploys a new programmable address contract for the specified destination.
Parameters:
  • destinationAddress: destination wallet address as bytes32 (cross-VM compatible)
  • depositor: Address authorized to trigger refunds
Returns:
  • Address of the deployed programmable address contract

getConfiguration

Returns all factory configuration values.

Configuration Getters

Individual getters for each configuration value:
  • DESTINATION_CHAIN() - Target chain ID
  • SOURCE_TOKEN() - Source token address
  • TARGET_TOKEN() - Target token (bytes32)
  • PORTAL_ADDRESS() - Portal contract address
  • PROVER_ADDRESS() - Prover contract address
  • DESTINATION_PORTAL() - Destination portal (bytes32)
  • INTENT_DEADLINE_DURATION() - Deadline duration
  • DEPOSIT_IMPLEMENTATION() - Implementation contract address

Events

DepositContractDeployed

Emitted when a new programmable address contract is deployed.

Errors

ContractAlreadyDeployed

Thrown when attempting to deploy a contract that already exists.

InvalidDeadlineDuration

Thrown during construction if deadline duration is zero.

InvalidPortalAddress

Thrown during construction if Portal address is zero.

InvalidProverAddress

Thrown during construction if Prover address is zero.

InvalidSourceToken

Thrown during construction if source token address is invalid.

InvalidTargetToken

Thrown during construction if target token is invalid.

InvalidDestinationPortal

Thrown during construction if destination Portal is zero bytes.