Native Asset Super Tokens
Super Tokens that Are Wrappers Around Native Assets
A native asset super token is similar to an ERC20 Wrapper token in that the contract itself is a wrapper around an existing asset. Native asset super token contracts allow you to deposit a native asset, such as ETH, MATIC, and AVAX into the contract, and receive a corresponding amount of the wrapped native asset in return (i.e. ETHx, MATICx, and AVAXx).
The most commonly used interface for native asset super token contracts is
ISETH.sol,which can be found here:
In essence, the
SETH.solcontract has a payable function called
upgradeByETH()which takes no parameters but is expected to receive some nonzero
msg.valuewhen it's called. This function will mint a number of native asset super tokens that is equivalent to the total amount of the
msg.valuesent along with the function call. Calling
downgradeToETH()and passing in the amount of the native asset super token you'd like to downgrade will burn native asset super tokens and send you back that amount of the underlying asset.
Native asset super tokens are deployed by the Superfluid community after the protocol is deployed on various networks. They're usually one of the first tokens deployed by community members, but if you'd like to deploy your own native asset super token, we suggest starting with the same logic found in the