Skip to main content

Get Randomness

Following this tutorial, you'll learn how to write a smart contract consuming randomness from Cryptosat Random Beacon contract.

Create and deploy contract

For this example, use ClientContract.sol sample contract

  1. Open ClientContract.sol in Remix

  2. Compile the contract on the Compile tab.

    Compile Contract

  3. Deploy your contract with Random Beacon contract address

    Select Injected Web3 environment and fill in 0xFf94BaE6D7d2ccf61db5593Dc899E3c68464cDdb for the Beacon Address

    • Velas Testnet: 0xFf94BaE6D7d2ccf61db5593Dc899E3c68464cDdb
    • Velas Mainnet: 0x8f5FE77380B83BaA7365ccc9956EB0594859F9E4

    Deploy

    MetaMask will ask you to confirm the transaction.

  4. After you deploy your contract, you can interact with it.

    Click on requestRandom button to request Space Random Beacon.

    getRandom