HoneyChatV1
Roles
Listed below are the roles on HoneyChatV1 and their responsibilities.
owner
Pause/unpause the contract
Set protocol addresses
Set fee percentages
Set subscription parameters
Withdraw lost funds
setPaused
setFeeDestination
setProtocolDev
setProtocolFeePercent
setSubjectFeePercent
setReferralFeePercent
setSubscriptionPrice
setSubscriptionDuration
withdrawFunds
protocolDev
Pause/unpause the contract
setPaused
View Methods
getPrice
getPrice(supply, amount)
Gets the total price of an amount
of shares with a specified supply
.
Call Parameters
supply
uint256
Current supply of shares
amount
uint256
Amount of shares to buy or sell
Return Value
uint256
Price for the amount of shares specified
getMyShares
getMyShares(sharesSubject)
Gets the total amount of shares that the caller owns of sharesSubject
.
Call Parameters
sharesSubject
address
Address of the user whose share balance to check
Return Value
uint256
Total amount of shares that the caller owns
getSharesSupply
getSharesSupply(sharesSubject)
Gets the total share supply of the sharesSubject
.
Call Parameters
sharesSubject
address
Address of the user whose share supply to check
Return Value
uint256
Total supply of the shares of the specified user
getBuyPrice
getBuyPrice(sharesSubject, amount)
Gets the price to buy an amount
of shares of the sharesSubject
at the current supply.
Call Parameters
sharesSubject
address
Address of the user whose share buy price to check
amount
uint256
Amount of shares to buy
Return Value
uint256
Buy price for the amount of shares specified
getSellPrice
getSellPrice(sharesSubject, amount)
Gets the price to sell an amount
of shares of the sharesSubject
at the current supply.
Call Parameters
sharesSubject
address
Address of the user whose share sell price to check
amount
uint256
Amount of shares to sell
Return Value
uint256
Sell price for the amount of shares specified
getBuyPriceAfterFee
getBuyPriceAfterFee(sharesSubject, amount)
Gets the total price to buy an amount
of shares of the sharesSubject
at the current supply, including fees. The return value should be passed as the msg.value
for a buyShares
or buySharesWithRefferer
transaction.
Call Parameters
sharesSubject
address
Address of the user whose share buy price to check
amount
uint256
Amount of shares to buy
Return Value
uint256
Total buy price for the amount of shares specified (including fees)
getSellPriceAfterFee
getSellPriceAfterFee(sharesSubject, amount)
Gets the total price to sell an amount
of shares of the sharesSubject
at the current supply, including fees. The return value should be passed as the msg.value
for a sellShares
transaction.
Call Parameters
sharesSubject
address
Address of the user whose share sell price to check
amount
uint256
Amount of shares to sell
Return Value
uint256
Total sell price for the amount of shares specified (including fees)
getSubscriptionPriceAfterFee
getSubscriptionPriceAfterFee()
Gets the total subscription price to subscribe to any user, including fees. The return value should be passed as the msg.value
for a buySubscription
or buySubscriptionWithRefferer
transaction.
Return Value
uint256
Total subscription price to subscribe to a user (including fees)
Write Methods
buySharesWithReferrer
buySharesWithReferrer(sharesSubject, amount, referrer) payable
Buy an amount
of shares of the sharesSubject
with a given referrer
. Must pass the appropriate msg.value
, returned from getBuyPriceAfterFee
, for the transaction to succeed. This function can only be called by new users that have not previously bought any shares or subscriptions. The referrer
earns fees on all future transactions that the caller makes.
Call Parameters
sharesSubject
address
Address of the user whose shares to buy
amount
uint256
Amount of shares to buy
referrer
address
Address of the user who referred the caller
buyShares
buyShares(sharesSubject, amount) payable
Buy an amount
of shares of the sharesSubject
. Must pass the appropriate msg.value
, returned from getBuyPriceAfterFee
, for the transaction to succeed.
Call Parameters
sharesSubject
address
Address of the user whose shares to buy
amount
uint256
Amount of shares to buy
sellShares
sellShares(sharesSubject, amount)
Sell an amount
of shares of the sharesSubject
.
Call Parameters
sharesSubject
address
Address of the user whose shares to sell
amount
uint256
Amount of shares to sell
enableSubscriptions
enableSubscriptions()
Enable subscriptions to the caller. Users can now pass the caller's address to buySubscription
and buyScriptionWithReferrer
.
disableSubscriptions
disableSubscriptions()
Disable new subscriptions to the caller. All existing subscriptions remain active until expiration.
buySubscriptionWithReferrer
buySubscriptionWithReferrer(subscriptionsSubject, referrer) payable
Buy a subscription to the subscriptionSubject
with a given referrer
. Must pass the appropriate msg.value
, returned from getSubscriptionPriceAfterFee
, for the transaction to succeed. This function can only be called by new users that have not previously bought any shares or subscriptions. The referrer
earns fees on all future transactions that the caller makes. You must wait for your current subscription to expire before resubscribing to a subscriptionSubject
.
Call Parameters
subscriptionsSubject
address
Address of the user to subscribe to
referrer
address
Address of the user who referred the caller
buySubscription
buySubscription(subscriptionsSubject) payable
Buy a subscription to the subscriptionSubject
. Must pass the appropriate msg.value
, returned from getSubscriptionPriceAfterFee
, for the transaction to succeed. You must wait for your current subscription to expire before resubscribing to a subscriptionSubject
.
Call Parameters
subscriptionsSubject
address
Address of the user to subscribe to
Last updated