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 on-chain transactions
  • Contract deployment: Deploys programmable address contracts when funds are received
  • Configuration storage: Holds immutable settings for all programmable address contracts it creates

Constructor

constructor(
    uint64 _destinationChain,
    address _sourceToken,
    bytes32 _targetToken,
    address _portalAddress,
    address _proverAddress,
    bytes32 _destinationPortal,
    uint64 _intentDeadlineDuration
)
ParameterTypeDescription
_destinationChainuint64Target chain ID
_sourceTokenaddressToken on source chain
_targetTokenbytes32Token on destination (bytes32 for cross-VM)
_portalAddressaddressRoutes Portal contract
_proverAddressaddressCross-chain prover
_destinationPortalbytes32Portal on destination chain
_intentDeadlineDurationuint64Intent validity period

Functions

getDepositAddress

Computes the deterministic programmable address for a given destination.
function getDepositAddress(bytes32 destinationAddress)
    external view returns (address)
Parameters:
  • destinationAddress: Solana wallet address as bytes32
Returns:
  • The EVM address where the user should send tokens

isDeployed

Checks if a programmable address contract has been deployed for a destination.
function isDeployed(bytes32 destinationAddress)
    external view returns (bool)

deploy

Deploys a new programmable address contract for the specified destination.
function deploy(
    bytes32 destinationAddress,
    address depositor
) external returns (address deployed)
Parameters:
  • destinationAddress: Solana wallet address as bytes32
  • depositor: Address authorized to trigger refunds
Returns:
  • Address of the deployed programmable address contract

getConfiguration

Returns all factory configuration values.
function getConfiguration() external view returns (
    uint64 destinationChain,
    address sourceToken,
    bytes32 targetToken,
    address portalAddress,
    address proverAddress,
    bytes32 destinationPortal,
    uint64 intentDeadlineDuration
)

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

event DepositContractDeployed(
    bytes32 indexed destinationAddress,
    address indexed depositAddress
)
Emitted when a new programmable address contract is deployed.
FieldTypeIndexedDescription
destinationAddressbytes32YesSolana wallet address
depositAddressaddressYesDeployed contract address

Errors

ContractAlreadyDeployed

error ContractAlreadyDeployed(address depositAddress)
Thrown when attempting to deploy a contract that already exists.

InvalidDeadlineDuration

error InvalidDeadlineDuration()
Thrown during construction if deadline duration is zero.

InvalidPortalAddress

error InvalidPortalAddress()
Thrown during construction if Portal address is zero.

InvalidProverAddress

error InvalidProverAddress()
Thrown during construction if Prover address is zero.

InvalidSourceToken

error InvalidSourceToken()
Thrown during construction if source token address is invalid.

InvalidTargetToken

error InvalidTargetToken()
Thrown during construction if target token is invalid.

InvalidDestinationPortal

error InvalidDestinationPortal()
Thrown during construction if destination Portal is zero bytes.