Repository
- Code: github.com/berachain/guides/tree/main/apps/pyth-entropy
- README (raw): raw README — an MCP or tool can fetch this for full steps.
Official documentation
- Pyth Entropy — concepts and API.
Requirements
- Node
v20.11.0or greater, npm - Wallet with Berachain testnet $BERA — Artio Faucet
- Foundry (
foundryup)
Stack
Solidity, Foundry (Forge), Node.js,@pythnetwork/entropy-sdk-solidity, OpenZeppelin contracts.
Quick start
-
Clone and install
Add remappings to
foundry.toml(see README). -
Configure
.envat project root:RPC_URL,PRIVATE_KEY,ENTROPY_ADDRESS,PROVIDER_ADDRESS(values in README). -
Deploy the NFT contract
Set
ENTROPY_NFT_ADDRESSin.envto the deployed address. -
Request a mint (script requests random number from Pyth and polls for the mint callback)
Key files
| Purpose | Path |
|---|---|
| NFT contract | src/EntropyNFT.sol |
| Mint request script | app/requestMint.js |