IPaymentManager
IPaymentManager
EarningType
enum EarningType {
LISTER_FIXED_FEE,
LISTER_EXTERNAL_ERC20_REWARD,
RENTER_EXTERNAL_ERC20_REWARD,
UNIVERSE_FIXED_FEE,
UNIVERSE_EXTERNAL_ERC20_REWARD,
PROTOCOL_FIXED_FEE,
PROTOCOL_EXTERNAL_ERC20_REWARD
}
UserEarned
event UserEarned(address user, enum IPaymentManager.EarningType earningType, address paymentToken, uint256 amount)
Emitted when a user has earned some amount tokens.
Name |
Type |
Description |
user |
address |
Address of the user that earned some amount. |
earningType |
enum IPaymentManager.EarningType |
Describes the type of the user. |
paymentToken |
address |
The currency that the user has earned. |
amount |
uint256 |
The amount of tokens that the user has earned. |
UniverseEarned
event UniverseEarned(uint256 universeId, enum IPaymentManager.EarningType earningType, address paymentToken, uint256 amount)
Emitted when the universe has earned some amount of tokens.
Name |
Type |
Description |
universeId |
uint256 |
ID of the universe that earned the tokens. |
earningType |
enum IPaymentManager.EarningType |
Describes the type of the user. |
paymentToken |
address |
The currency that the user has earned. |
amount |
uint256 |
The amount of tokens that the user has earned. |
ProtocolEarned
event ProtocolEarned(enum IPaymentManager.EarningType earningType, address paymentToken, uint256 amount)
Emitted when the protocol has earned some amount of tokens.
Name |
Type |
Description |
earningType |
enum IPaymentManager.EarningType |
Describes the type of the user. |
paymentToken |
address |
The currency that the user has earned. |
amount |
uint256 |
The amount of tokens that the user has earned. |
handleRentalPayment
function handleRentalPayment(struct Rentings.Params rentingParams, struct Rentings.RentalFees fees, address payer, uint256 maxPaymentAmount, bytes tokenQuote, bytes tokenQuoteSignature) external returns (struct Accounts.RentalEarnings rentalEarnings, struct ITokenQuote.PaymentTokenData paymentTokenData)
Redirects handle rental payment from RentingManager to Accounts.Registry
Name |
Type |
Description |
rentingParams |
struct Rentings.Params |
Renting params. |
fees |
struct Rentings.RentalFees |
Rental fees. |
payer |
address |
Address of the rent payer. |
maxPaymentAmount |
uint256 |
Maximum payment amount. |
tokenQuote |
bytes |
Encoded token quote data. |
tokenQuoteSignature |
bytes |
Encoded ECDSA signature for checking token quote data for validity. |
Name |
Type |
Description |
rentalEarnings |
struct Accounts.RentalEarnings |
Payment token earnings. |
paymentTokenData |
struct ITokenQuote.PaymentTokenData |
Payment token data. |
handleExternalERC20Reward
function handleExternalERC20Reward(struct Listings.Listing listing, struct Rentings.Agreement agreement, struct ERC20RewardDistributionHelper.RentalExternalERC20RewardFees rentalExternalERC20RewardFees) external returns (struct Accounts.RentalEarnings rentalExternalRewardEarnings)
Redirects handle external ERC20 reward payment from ERC20RewardDistributor to Accounts.Registry.
Metahub must have enough funds to cover the distribution.
ERC20RewardDistributor makes sure of that.
Name |
Type |
Description |
listing |
struct Listings.Listing |
Represents, related to the distribution, listing. |
agreement |
struct Rentings.Agreement |
Represents, related to the distribution, agreement. |
rentalExternalERC20RewardFees |
struct ERC20RewardDistributionHelper.RentalExternalERC20RewardFees |
Represents calculated fees based on all terms applied to external reward. |
withdrawProtocolFunds
function withdrawProtocolFunds(address token, uint256 amount, address to) external
Transfers the specific `amount` of `token` from a protocol balance to an arbitrary address.
Name |
Type |
Description |
token |
address |
The token address. |
amount |
uint256 |
The amount to be withdrawn. |
to |
address |
The payee address. |
withdrawUniverseFunds
function withdrawUniverseFunds(uint256 universeId, address token, uint256 amount, address to) external
Transfers the specific `amount` of `token` from a universe balance to an arbitrary address.
Name |
Type |
Description |
universeId |
uint256 |
The universe ID. |
token |
address |
The token address. |
amount |
uint256 |
The amount to be withdrawn. |
to |
address |
The payee address. |
withdrawFunds
function withdrawFunds(address token, uint256 amount, address to) external
Transfers the specific `amount` of `token` from a user balance to an arbitrary address.
Name |
Type |
Description |
token |
address |
The token address. |
amount |
uint256 |
The amount to be withdrawn. |
to |
address |
The payee address. |
protocolBalance
function protocolBalance(address token) external view returns (uint256)
Returns the amount of `token`, currently accumulated by the protocol.
Name |
Type |
Description |
token |
address |
The token address. |
Name |
Type |
Description |
[0] |
uint256 |
Balance of `token`. |
protocolBalances
function protocolBalances() external view returns (struct Accounts.Balance[])
Returns the list of protocol balances in various tokens.
Name |
Type |
Description |
[0] |
struct Accounts.Balance[] |
List of balances. |
universeBalance
function universeBalance(uint256 universeId, address token) external view returns (uint256)
Returns the amount of `token`, currently accumulated by the universe.
Name |
Type |
Description |
universeId |
uint256 |
The universe ID. |
token |
address |
The token address. |
Name |
Type |
Description |
[0] |
uint256 |
Balance of `token`. |
universeBalances
function universeBalances(uint256 universeId) external view returns (struct Accounts.Balance[])
Returns the list of universe balances in various tokens.
Name |
Type |
Description |
universeId |
uint256 |
The universe ID. |
Name |
Type |
Description |
[0] |
struct Accounts.Balance[] |
List of balances. |
balance
function balance(address account, address token) external view returns (uint256)
Returns the amount of `token`, currently accumulated by the user.
Name |
Type |
Description |
account |
address |
The account to query the balance for. |
token |
address |
The token address. |
Name |
Type |
Description |
[0] |
uint256 |
Balance of `token`. |
balances
function balances(address account) external view returns (struct Accounts.Balance[])
Returns the list of user balances in various tokens.
Name |
Type |
Description |
account |
address |
The account to query the balance for. |
Name |
Type |
Description |
[0] |
struct Accounts.Balance[] |
List of balances. |