-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change contracts by inheriting ApplicationBase
- Loading branch information
Showing
24 changed files
with
494 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{ | ||
"BaseSepolia": { | ||
"Application": "0xf628B6024af73D0f29c251e0fB306e5f8bA6FcFA", | ||
"Marketplace": "0xC6B5c98FD8A8C9d8aa2B0f79a66EC55b0D2dad69", | ||
"AccessIdentities": "0x4Cd640e4177a5d86B06BDB147E7efECFf3E478b3" | ||
"Marketplace": "0x397C2649409F4dA69e8191e75A5Fe7Bb26cde597" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.24; | ||
|
||
interface IMarketplace { | ||
// Statuses of a listing. WithdrawnOrNotExist, which is 0, is effectively the same as never listed before. | ||
enum ListingStatus { | ||
WithdrawnOrNotExist, | ||
Listing, | ||
Delisted | ||
} | ||
|
||
// Statuses of a rental. EndedOrNotExist, which is 0, is effectively the same as never exist before. | ||
enum RentalStatus { | ||
EndedOrNotExist, | ||
Renting | ||
} | ||
|
||
struct ListingInfo { | ||
address owner; | ||
uint256 minRentalDays; | ||
uint256 maxRentalDays; | ||
address rentCurrency; | ||
uint256 dailyRent; | ||
address payable rentRecipient; | ||
ListingStatus status; | ||
} | ||
|
||
struct RentalInfo { | ||
uint256 accessId; | ||
uint256 startTime; | ||
uint256 endTime; | ||
uint256 rentalDays; | ||
address rentCurrency; | ||
uint256 dailyRent; | ||
uint256 totalPaidRent; | ||
RentalStatus status; | ||
} | ||
|
||
event List( | ||
address indexed owner, | ||
address indexed device, | ||
uint256 minRentalDays, | ||
uint256 maxRentalDays, | ||
address rentCurrency, | ||
uint256 dailyRent, | ||
address rentRecipient | ||
); | ||
|
||
event Delist(address indexed owner, address indexed device); | ||
|
||
event Relist( | ||
address indexed owner, | ||
address indexed device, | ||
uint256 minRentalDays, | ||
uint256 maxRentalDays, | ||
address rentCurrency, | ||
uint256 dailyRent, | ||
address rentRecipient | ||
); | ||
|
||
event Rent( | ||
address indexed device, | ||
uint256 indexed accessId, | ||
address indexed tenant, | ||
uint256 startTime, | ||
uint256 endTime, | ||
uint256 rentalDays, | ||
uint256 prepaidRent | ||
); | ||
|
||
event PayRent( | ||
address indexed device, | ||
uint256 rent | ||
); | ||
|
||
event EndLease( | ||
address indexed device, | ||
address operator | ||
); | ||
|
||
event Withdraw(address indexed owner, address indexed device); | ||
|
||
function getListingInfo( | ||
address device | ||
) external view returns (ListingInfo memory); | ||
|
||
function getRentalInfo( | ||
address device | ||
) external view returns (RentalInfo memory); | ||
|
||
function setFeePoints(uint256 feePoints) external; | ||
|
||
function setTreasury(address payable treasury) external; | ||
|
||
function addRentCurrencies(address[] memory rentCurrencies) external; | ||
|
||
function removeRentCurrencies(address[] memory rentCurrencies) external; | ||
|
||
function list( | ||
address device, | ||
uint256 minRentalDays, | ||
uint256 maxRentalDays, | ||
address rentCurrency, | ||
uint256 dailyRent, | ||
address rentRecipient | ||
) external; | ||
|
||
function delist(address device) external; | ||
|
||
function relist( | ||
address device, | ||
uint256 minRentalDays, | ||
uint256 maxRentalDays, | ||
address rentCurrency, | ||
uint256 dailyRent, | ||
address rentRecipient | ||
) external; | ||
|
||
function rent( | ||
address device, | ||
address tenant, | ||
uint256 rentalDays, | ||
uint256 prepaidRent, | ||
string memory accessURI | ||
) external payable; | ||
|
||
function payRent( | ||
address device, | ||
uint256 rent_ | ||
) external payable; | ||
|
||
function endLease(address device) external; | ||
|
||
function withdraw(address device) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.