Energy Rental
Introduction
All transactions on JustLend DAO require Energy, which can only be acquired through staking or burning TRX. This process involves high costs and lengthy procedures. In response, JustLend DAO introduces the Energy Rental service, allowing users to rent Energy at a significantly reduced price compared to staking or burning TRX. The contract EnergyRental used to set up the Energy Rental service.
Solidity API
Query Interface
Query Rental order information
View the information of an order.
Parameter description:
Returns Values:
Query current rental order information (updated to current)
View the information of an order, with the returned data updated to current.
Parameter description:
Returns Values:
Write Interface
Rent resources
Rent resources, allow amount = 0 (extension only) or msg.value = 0 (no new deposit), both are 0 is not allowed.
Parameter description:
Returns: None, revert on failure.
Return resources (called by payer)
Return resources. Return resources in the order (msg.sender, receiver, resourceType). When the remaining deposit is insufficient, all resources will be forcibly emptied, and the remaining deposit will be returned to the order payer.
Parameter description:
Returns: The amount of the deposit returned in this operation. 0 for a partial return.
Return resources (called by receiver)
Return resources. Return resources in the order (renter, msg.sender, resourceType). When the remaining deposit is insufficient, all resources will be forcibly emptied, and the remaining deposit will be returned to the order payer.
Parameter description:
Returns: The amount of the deposit returned in this operation. 0 for partial return.
Liquidate
When the order deposit is insufficient, the liquidator can liquidate the order, and the liquidator will get the liquidation reward. If there is any remaining deposit, it will be returned to the order payer.
Parameter description:
Returns: Liquidation reward in this operation.
Key Events
Last updated