Rental Smart Contract Interaction Guide
This guide provides detailed instructions on how to interact with a Rental Smart Contract on the Stellar blockchain. Before proceeding, make sure to clone and build the Setlien project from the GitHub repository (https://github.com/arbach/stelien) to generate the setlien.wasm file.
The steps outlined below include deployment, initialization, lease, rent, end lease, end rent, and claim token operations
1. Deploy:
Deploy the smart contract using the soroban contract deploy
command. This step returns a RENTAL_CONTRACT_ID
that will be used in the subsequent operations.
2. Initialize:
The initialization step sets the admin of the rental contract and the payment token that is accepted for payments. Use the soroban contract invoke
command to perform this step.
3. Lease:
This step allows a leaser to list their NFT token for leasing. Use the soroban contract invoke
command with the lease
argument to perform this step. The transaction is signed by the LEASER_SECRET_KEY
.
4. Rent:
This step allows a renter to pay with the PAYMENT_TOKEN
and rent the NFT token listed by the leaser. Use the soroban contract invoke
command with the rent
argument to perform this step. The transaction is signed by the RENTER_SECRET_KEY
.
5. End Lease:
This step allows a leaser to delist their NFT token from leasing. Use the soroban contract invoke
command with the end_lease
argument to perform this step. The transaction is signed by the LEASER_SECRET_KEY
.
6. End Rent:
This step allows a renter to return their rented NFT token. Use the soroban contract invoke
command with the end_rent
argument to perform this step. The transaction is signed by the RENTER_SECRET_KEY
.
7. Claim Token:
This step allows a leaser to claim their NFT token that was rented and wasn't returned on time. Use the soroban contract invoke
command with the claim_token
argument to perform this step. The transaction is signed by the LEASER_SECRET_KEY
.
Please ensure you replace all instances of ${VARIABLE_NAME}
in the commands above with your actual data.
Last updated