ClayManager.sol
Main csMATIC contract for Polygon staking.
getExchangeRate()
Returns the current exchange rate accounting for any slashing or donations and a boolean value indicating whether a slashing event has occurred (Note: Slashing is not currently enabled on Polygon).
getLiquidityCsToken()
Returns total liquidity of csToken available for Flash Exit without considering external pools.
fees()
Returns all types protocol's fees. Protocol uses 2 point decimal precision(i.e base unit is 10000)
Fees Structure:
bridgeFee()
Fee to manually trigger the bridge by user
getUserOrders()
Returns paginated list of user's withdraw orders in descending order of creation.
UserWithdrawOrder Structure:
deposit()
Sends underlying tokens to contract and mints csToken to msg.sender
.
Note: Requirements:
msg.sender
must have approvedamountToken
of Token to this contract.
Parameters:
Returns:
Bool confirmation of transaction.
depositDelegate()
Sends Token to contract and mints csToken to delegator
.
Note: Requirements:
msg.sender
must have approvedamountToken
of Token to this contract.
Parameters:
Returns:
Bool confirmation of transaction.
depositETH()
Sends native to chain tokens msg.value
to contract and mints csToken to msg.sender
.
withdraw()
Burns csToken from user and creates a withdraw order.
Note: Requirements:
msg.sender
must have approvedamountCs
of csToken to this contract.
Parameters:
Returns:
Withdraw Order ID.
claim()
Checks the validity of given orderIds
, claims tokens and transfers the amount to user.
Note: Requirements:
All orderIds must have fulfilled the un-bonding period.
Parameters:
Returns:
Bool confirmation of transaction.
instantWithdraw()
Burns csToken from user and instantly returns Token to user.
Note: Requirements:
msg.sender
must have approvedamountCs
of csToken to this contract.Contract must have sufficient liquidity.
Parameters:
Returns:
Bool confirmation of transaction.
earlyClaim()
Checks the validity of given orderId
, claims tokens and transfers the amount to user.
Note: Requirements:
Order must be early claimable eligible and no slashing occurred within batch.
Parameters:
Returns:
Bool confirmation of transaction.
autoBalance()
Initiates transfer process to Ethereum while sends a message on expected tokens. A minimum amount or time is required for it to execute unless paid fee by the caller msg.value
must exceed the bridge fee.
Returns:
Bool confirmation of transaction.