-
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.
- Loading branch information
Showing
29 changed files
with
8,273 additions
and
678 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
118 changes: 118 additions & 0 deletions
118
packages/hardhat/contracts/interfaces/IVisibilityCredits.sol
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,118 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
interface IVisibilityCredits { | ||
struct CreditsTradeEvent { | ||
address from; | ||
string visibilityId; | ||
uint256 amount; | ||
bool isBuy; | ||
uint256 tradeCost; | ||
uint256 creatorFee; | ||
uint256 protocolFee; | ||
uint256 referrerFee; | ||
address referrer; | ||
uint256 newTotalSupply; | ||
uint256 newCurrentPrice; | ||
} | ||
|
||
event CreatorFeeClaimed(address indexed creator, uint256 amount); | ||
|
||
event CreatorVisibilitySet(string visibilityId, address creator); | ||
|
||
event CreditsTrade(CreditsTradeEvent tradeEvent); | ||
|
||
event CreditsTransfer( | ||
string visibilityId, | ||
address indexed from, | ||
address indexed to, | ||
uint256 amount | ||
); | ||
|
||
error InvalidAddress(); | ||
error InvalidCreator(); | ||
error InvalidAmount(); | ||
error InvalidFeeParams(); | ||
error NotEnoughEthSent(); | ||
error NotEnoughCreditsOwned(); | ||
|
||
function buyCredits( | ||
string calldata visibilityId, | ||
uint256 amount, | ||
address referrer | ||
) external payable; | ||
|
||
function sellCredits( | ||
string calldata visibilityId, | ||
uint256 amount, | ||
address referrer | ||
) external; | ||
|
||
function claimCreatorFee(string calldata visibilityId) external; | ||
|
||
function setCreatorVisibility( | ||
string calldata visibilityId, | ||
address creator | ||
) external; | ||
|
||
function transferCredits( | ||
string calldata visibilityId, | ||
address from, | ||
address to, | ||
uint256 amount | ||
) external; | ||
|
||
function updateTreasury(address treasury) external; | ||
|
||
function getVisibility( | ||
string calldata visibilityId | ||
) | ||
external | ||
view | ||
returns ( | ||
address creator, | ||
uint256 totalSupply, | ||
uint256 claimableFeeBalance | ||
); | ||
|
||
function getVisibilityCreditBalance( | ||
string calldata visibilityId, | ||
address account | ||
) external view returns (uint256); | ||
|
||
function getVisibilityCurrentPrice( | ||
string calldata visibilityId | ||
) external view returns (uint256); | ||
|
||
function getVisibilityKey( | ||
string calldata visibilityId | ||
) external pure returns (bytes32); | ||
|
||
function buyCostWithFees( | ||
string calldata visibilityId, | ||
uint256 amount, | ||
address referrer | ||
) | ||
external | ||
returns ( | ||
uint256 totalCost, | ||
uint256 tradeCost, | ||
uint256 creatorFee, | ||
uint256 protocolFee, | ||
uint256 referrerFee | ||
); | ||
|
||
function sellCostWithFees( | ||
string calldata visibilityId, | ||
uint256 amount, | ||
address referrer | ||
) | ||
external | ||
returns ( | ||
uint256 reimbourcement, | ||
uint256 tradeCost, | ||
uint256 creatorFee, | ||
uint256 protocolFee, | ||
uint256 referrerFee | ||
); | ||
} |
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.