GOAT Network
Services

GOAT VRF

GOAT VRF uses the drand network to deliver verifiable randomness to EVM contracts on GOAT Network.

Request Flow

VRF request flow
Consumer contract
      |
      v
Request randomness from GoatVRF
      |
      v
Relayer watches requests
      |
      v
drand proof submitted onchain
      |
      v
Consumer callback receives randomness

Components

ComponentRole
GoatVRF contractVerifies proofs and stores request state
Oracle or relayer servicePulls randomness from drand and submits proofs
Consumer contractRequests randomness and implements the callback

Consumer Integration

Consumer contract pattern
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

interface IRandomnessCallback {
  function receiveRandomness(uint256 requestId, uint256 randomness) external;
}
Request randomness
uint256 callbackGas = 600000;
uint256 fee = IGoatVRF(goatVRF).calculateFeeWithGasPrice(callbackGas, maxAllowedGasPrice);
uint256 deadline = block.timestamp + IDrandBeacon(IGoatVRF(goatVRF).beacon()).period();
requestId = IGoatVRF(goatVRF).getNewRandom(deadline, maxAllowedGasPrice, callbackGas);

The fee token is WGOATBTC. Approve enough allowance before calling getNewRandom, and leave headroom if you expect gas-price movement between estimation and fulfillment.

Fee Rule Types

Fee ruleDescription
FixedUses a static fee plus callback gas cost
APRO_BTCAdjusts against the APRO BTC price feed to keep a target USD-denominated value

Deployments

Testnet3

Mainnet

Development Commands

Foundry commands
forge build
forge test
forge script script/Deploy.s.sol --rpc-url <rpc_url> --broadcast

On this page