See·two-phase async
ᛞ
Video Generation
Generate video
Configurable FPS, dimensions. Long-running async.
0x000000000000000000000000000000000000081AExplorer
Cached DiT. Wan2.2 backend pre-warms a single shape — width / height / durationMs you pass may be clamped. Response
durationMs reflects what was actually produced.click 'auto' (capability = 6)
px
px
ms
min escrow: 0.2000 RITUALyou have: — RITUAL
Connect your wallet to submit a real transaction.
to: 0x000000000000000000000000000000000000081AchainId 1979 · two-phase
Output
Click Validate to encode the video request.
1280×720 · 24fps · 3.0s
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {PrecompileConsumer} from "./utils/PrecompileConsumer.sol";
contract VideoGenerator is PrecompileConsumer {
address constant VIDEO = address(0x81A);
address constant ASYNC_DELIVERY = 0x5A16214fF555848411544b005f7Ac063742f39F6;
event VideoRequested(bytes32 indexed jobId, address indexed sender);
event VideoReady(
bytes32 indexed jobId,
string uri,
uint32 width,
uint32 height,
uint32 durationMs
);
/// @dev Cached DiT — backend may clamp width/height/durationMs to its
/// pre-warmed shape. `durationMs` in the response is what was actually
/// produced, not what you requested.
function generate(address executor) external {
// … see /playground/video for full encode call
}
function onVideoReady(bytes32 jobId, bytes calldata result) external {
require(msg.sender == ASYNC_DELIVERY, "unauth");
(
bool hasError, , string memory uri, , ,
uint64 sizeBytes, uint32 width, uint32 height, uint32 durationMs,
/* errorMessage */
) = abi.decode(result, (bool, bytes, string, bytes32, bool, uint64, uint32, uint32, uint32, string));
require(!hasError, "video gen failed");
emit VideoReady(jobId, uri, width, height, durationMs);
}
}