Pre-General Availability: 2026-03-13
Install ERC-1155 Smart Contracts
You can use the smart contracts provided with the platform to explore scenarios that support a bond marketplace and art collection marketplace that uses loyalty points.
The following instructions have been tested on macOS and Linux systems.
- Enter the following command to extract the ERC-1155 package.
unzip obp-da-erc1155.zip -d <path/to/directory> - Use nvm to install Node.js and npm. For best results, use Node.js version 20.17.0 and npm version 10.8.2.For more information about nvm, see Node Version Manager on GitHub.
- Run the following command to confirm that version 2.28.0 of Hardhat is installed.
npx hardhat –version - Navigate to the directory where you extracted the package, and then run the following command to compile the reference implementations of the smart contracts.
npx hardhat clean & npx hardhat compile - Run the following command to run unit tests on the contracts.
npx hardhat test - Deploy the art collection reference implementation.
- Run the following commands to set the Hardhat configuration variables, as described in the following table.
npx hardhat vars set BESU_CHAIN_ID <chain_id> npx hardhat vars set BESU_RPC_URL <rpc_url> npx hardhat vars set BESU_RPX_PROXY_AUTH_TOKEN "Bearer <auth-token>" npx hardhat vars set BESU_ACCOUNTS <account keys> npx hardhat vars set BESU_ALLOW_SELF_SIGNED <true or false>In the limited availability version of the platform, the contract is deployed by using the account keys that are configured in the Hardhat variable. Use one of the pre-funded account keys when you deploy.Variable Description Default value BESU_CHAIN_IDChain ID of the Besu network 1337 BESU_RPC_URLURL of the RPC proxy with a passthrough endpoint http://127.0.0.1:8545 BESU_RPX_PROXY_AUTH_TOKENAuth token of the Oracle Blockchain Platform RPC proxy '' BESU_ACCOUNTSAccount keys for deployment "" BESU_ALLOW_SELF_SIGNEDFlag that allows Hardhat to communicate with Hyperledger Besu by using self-signed certificates without providing CA certificatess ( NODE_TLS_REJECT_UNAUTHORIZED=0)true - Run the following command to set the path for the OpenZeppelin manifest file, adjusting the path as needed for your system.
export MANIFEST_DEFAULT_DIR=.openzeppelin/tests - Run the Hardhat script to deploy the account and the art collection smart contract.
npx hardhat run scripts/art-loyalty/deploy-art-loyalty.ts --network besuThe script runs and shows the contract addresses for the account and the art collection contract. Record the contract addresses and the OpenZeppelin manifest files for use when interacting with the contract via RPC proxy HTTP calls.
- Run the following commands to set the Hardhat configuration variables, as described in the following table.
- Deploy the bond marketplace reference implementation.
- Set the Hardhat configuration variables as described in the previous step.
- Run the following command to set the path for the OpenZeppelin manifest file, adjusting the path as needed for your system.
export MANIFEST_DEFAULT_DIR=.openzeppelin/tests - Run the Hardhat script to deploy the account and the bond marketplace smart contract.
npx hardhat run scripts/bond/deploy-bond.ts --network besuThe script runs and shows the contract addresses for the account and the bond marketplace contract. Record the contract addresses and the OpenZeppelin manifest files for use when interacting with the contract via RPC proxy HTTP calls.