Skip to main content

addComposeHash

Registers a new compose hash on the AppAuth smart contract. This is required when updating a CVM that uses on-chain KMS (ETHEREUM/BASE) — the updated compose hash must be registered on-chain before the Phala Cloud API will accept the update. This function interacts directly with the blockchain (not the Phala Cloud API). When to use. Call this function in either of these cases:
Contract owner pre-check. Before submitting the transaction, the function reads owner() from the AppAuth contract and throws if the sender address does not match. This fails fast so you don’t waste gas on a transaction that would revert on-chain. Sign with the contract owner’s private key, or pass a wallet client whose account is the contract owner.
Parameters: Callbacks: Returns: AddComposeHash Example:

safeAddComposeHash

Safe variant that returns a SafeResult<AddComposeHash> instead of throwing on errors.