Actions
This page lists all actions on the dapp.fusion contract, including their descriptions and a list of the parameters for each action.
Quick Links
addadmin
Adds a new admin wallet into the config table. Admin wallets are able to call certain actions that don't pose any risk to user funds, but are sensitive enough that they should not be able to be called by random wallets. Requires auth of this contract.
admin_to_add
name
The WAX address of the admin to be added to the table
addcpucntrct
Adds a new CPU contract to the config table. CPU contracts are the contracts that funds are sent to when staking/renting WAX to users (or the fallback_cpu_receiver). Requires auth of this contract.
contract_to_add
name
The WAX address of the CPU contract to be added to the table
claimaslswax
Allows an sWAX holder to claim their claimable_wax, and have it converted to lsWAX in a single transaction. Requires auth of the user with the claimable balance.
user
name
The wallet address of the user signing the transaction
minimum_output
asset
The minimum amount of lsWAX the user expects to receive
claimgbmvote
Claims voting rewards from the CPU contract passed to the action. Voting rewards are automatically sent back to the main contract and added to the revenue_awaiting_distribution bucket. Can be called by anyone.
cpu_contract
name
The WAX address of the CPU contract that has voting rewards to claim
claimrefunds
Loops through the cpu_contracts in the config table, and claims available refunds from the system contract if any are available. Can be called by anyone.
claimrewards
Allows a user to claim their claimable_wax. Requires auth of the user with a claimable_wax balance.
user
name
The WAX address of the user who is claiming their rewards
claimswax
Allows a user to compound their sWAX by turning their claimable_wax into more sWAX. Requires auth of the user.
user
name
The WAX address of the user who is claiming their rewards
clearexpired
Allows a user to delete any of their expired redemption requests from the redeem_requests table, freeing up their RAM. Requires auth of the user.
user
name
The WAX address of the user who is claiming their rewards
compound
Claims any rewards available for swax_currently_backing_lswax, and uses them to buy more sWAX to increase the backing of lsWAX. Can be called by anyone, once every 5 minutes.
createfarms
Takes any lsWAX from the state2 singleton's incentives_bucket, and creates LP farms on Alcor. Farm allocations are in proportion to the poolId's parts_to_allocate / total parts of all pairs in the lpfarms table. Can be called by anyone.
init
Initializes the global singleton, rewards singlegon, and creates the initial epoch. Requires auth of this contract.
inittop21
Initializes the top21 singleton. Requires auth of this contract.
instaredeem
Allows users to instantly redeem their sWAX for liquid WAX instead of submitting a request and waiting 1-21 days. Incurs a 0.05% fee which goes to the protocol, and is only available if the amount of WAX in wax_available_for_rentals is >= the amount of sWAX the user wants to redeem. Requires auth of the user.
user
name
The WAX address of the user who wants to instaredeem
swax_to_redeem
asset
The amount of sWAX that the user wants to redeem for liquid WAX
liquify
Allows a user to convert their sWAX into lsWAX. Requires auth of the user.
user
name
The WAX address of the user who wants to liquify
quantity
asset
The amount of sWAX the user wants to liquify
liquifyexact
Allows a user to convert their sWAX into lsWAX, and also specify the minimum amount of lsWAX they expect to receive. While there is not actually any slippage/price impact incurred when liquifying, we decided it was a good idea to allow users to specify their minimum output in case they are trying to arbitrage on exchanges, and want to make sure they know exactly how much of an asset they are trading. Requires auth of the user.
user
name
The WAX address of the user who is calling the action
quantity
asset
The amount of sWAX that the user wants to liquify
minimum_output
asset
The amount of lsWAX the user expects to receive
reallocate
If the most recent redemption window has ended, this action takes any unredeemed funds and reallocates them by recycling them back into the wax_available_for_rentals pool. Can be called by anyone.
redeem
If a user has requested a redemption, and the redemption window for their request is currently active, they can call this action to claim the requested funds. Requires auth of the user.
user
name
The WAX address of the user who wants to redeem funds
removeadmin
Removes an admin wallet from the config singleton. Requires auth of this contract.
admin_to_remove
name
The WAX address of the admin wallet to remove
reqredeem
Allows a user to request a redemption so they can convert their sWAX into liquid WAX. Requires auth of the user.
user
name
The WAX address of the user who wants to request a redemption
swax_to_redeem
asset
The amount of sWAX that the user wants to redeem
accept_replacing_prev_requests
bool
Redemption requests will replace any previous redemption requests. If this is set to false, the transaction will fail unless the user has no pending requests
rmvcpucntrct
Removes a CPU contract from the config singleton. Requires auth of this contract.
contract_to_remove
name
The WAX address of the CPU contract to remove
rmvincentive
Removes an incentive from the lpfarms table. Requires auth of this contract.
poolId
uint64_t
The pool ID of the pair on Alcor's swap.alcor contract
setfallback
Allows an admin wallet to set the fallback_cpu_receiver in the config table. Requires auth of the admin wallet calling the action.
caller
name
The WAX address of the admin wallet calling this action
receiver
name
The WAX address of the new fallback_cpu_receiver
setincentive
Adds or updates an incentive in the lpfarms table. Requires auth of this contract.
poolId
uint64_t
The pool ID of the pair that we want to incentivize on Alcor's swap.alcor contract
symbol_to_incentivize
symbol
The symbol of the token to create a farm for
contract_to_incentivize
name
The contract of the token to create a farm for
percent_share_1e6
uint64_t
The 1e6 scaled percentage of liquidity rewards to allocate to this pair
setpolshare
Adjusts the percentage of revenue that goes to the protocol. This can only be set between 5-10%. Note that this does not affect the percentage that goes to users - it only changes the balance between protocol/ecosystem fund. Requires auth of this contract.
pol_share
uint64_t
The 1e6 scaled percentage of revenue that should go to protocol owned liquidity
setrentprice
Allows an admin wallet to adjust the price for CPU rentals. Requires auth of the admin wallet calling the action.
caller
name
The WAX address of the admin wallet calling this action
cost_to_rent_1_wax
asset
The WAX amount to charge for each 1 WAX rented for 1 full day
stake
This action is required before a user is able to mint sWAX. It stores a row for the user in the stakers table, for which they pay the RAM cost. Requires auth of the user.
user
name
The WAX address of the user calling this action
stakeallcpu
If the current time is >= the next_stakeall_time in the state singleton, this action will take any funds from the wax_available_for_rentals bucket and stake them to the fallback_cpu_receiver, in the epoch that is next in the rotation. Can be called by anyone.
sync
Allows any admin wallet to sync the contract state with the current time. Requires auth of the admin wallet calling the action.
caller
name
The WAX address of the admin wallet calling the action
unstakecpu
If the current time is >= the time_to_unstake of the epoch that started prior to the current epoch, this action can be called to unstake the CPU from that epoch, ensuring that the WAX is returned to the dapp contract in time for the redemption window. Can be called by anyone.
epoch_id
uint64_t
By default (if you submit 0 as the epoch_id), the contract will attempt to unstake CPU from the most recently ended epoch. You can override this behavior by specifying an epoch_id to unstake from
limit
int
By default (if you submit 0 as the limit), the contract will process up to 500 rows when unstaking CPU. You can override this by specifying a limit
updatetop21
If it has been >= 24 hours since the last time the top21 table was updated, anyone can call this action to sync the top21 table with the current state of the chain.
Last updated