Pre-General Availability: 2026-03-13

Sample Smart Contracts

Oracle Blockchain Platform Enterprise Edition for Hyperledger Besu includes sample smart contracts, which are available on the Developer Tools page in the service console.

Select the Download options menu for each contract to download the Solidity source code or the application binary interface (ABI). You can use this information to interact with deployed smart contracts by using RPC proxy API calls. You can also import the source code into a Solidity development environment such as Hardhat or Remix and make changes or enhancements as needed.

Hash Time-Locked Contract (HTLC)

This contract is deployed when you create an instance. The Hash Time-Locked Contract enables atomic exchanges of ETH and ERC-20 tokens, where a receiver claims a payment prior to a deadline or the payment is refunded to the sender. The contract supports the following operations.
  • Exchange ETHor ERC-20 tokens.
  • Lock funds for a receiver under a secret condition for a specified amount of time.
  • Claim locked funds by providing the correct secret before the lock expires.
  • Refund unclaimed locked funds to the sender after the lock expires.
  • Get the status of a locked exchange, including whether is has been claimed or refunded, the locked amount, and the lock deadline.

Soul Bound Token (SBT)

This contract is not predeployed. You must download and compile the source code and then deploy the contract by using tools such as Hardhat or the RPC proxy API. The Soul Bound Token contract implements a non-transferable NFT-style credential that is tied to a wallet identity. Tokens can only be issued, verified, revoked, or burned by the token holder. They cannot be sold or moved. The contract supports the following operations.
  • The contract owner (administrator) can issue or revoke credentials (mint or burn soul-bound tokens in a wallet).
  • Applications can check if a wallet contains a soul-bound token and read available token metadata (URI).
  • The token holder can burn their soul-bound token.

LockBox

This contract is deployed when you create an instance. The LockBox contract implements a time-locked vault that holds ETH and ERC-20 tokens and then releases the contents to a designated owner at a specific time. The contract supports the following operations.
  • Deposit funds into the vault by sending ETH directly or transferring ERC-20 tokens.
  • Get vault details, including who the beneficiary/owner is, what the release time is, and what tokens/ETH are in the vault. Any user can get this information.
  • Release funds at a specified time. After the specified time stamp, the owner can call the release action to retrieve the funds.