-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pure Super Token with xERC20 support #31
Comments
I considered starting from a forked https://github.com/defi-wonderland/xERC20 and adding Super Token there. But it's more cumbersome to get into a 3rd party repo, especially considering that it requires via-ir (stack too deep errors otherwise), making the development process much more cumbersome. So now I continue with BridgedSuperToken.sol, adding xER20 specific unit tests. Or maybe I start with a new repo, so I don't have the bootstrapping trouble (v2 here is without foundry). Functionality to be added: setters: getters: Explanation of the rate limiting mechanismThe proposed interface specifies a data structure and methods for setting and querying limits, but doesn't specify the concrete algorithm for how to interpret the params. When a This means that in order to allow higher bursts, the DURATION should be set to a high value, while in order to allow high overall throughput with limited bursts, DURATION should be set lower. Issues
|
Implementation repo: https://github.com/d10r/xerc20-supertoken |
TODO: check what exactly we want on the home chain. Does it make sense to add any xERC20 specific extensions? |
next: tooling to deploy between Optimism Stack based L1 and L2. See https://github.com/superfluid-finance/averageX/issues/44
TestnetL1StandardBridge: 0xFBb0621E0B23b5478B630BD55a5f21f67730B0F1 The repo now has a variant OPBridgedSuperTokenProxy which implements the interface |
deployment tooling (combination of foundry and shell script) added, now allows usage like this:
See https://github.com/d10r/xerc20-supertoken?tab=readme-ov-file#build--deploy |
What & Why
We want a canonical implementation of a Pure SuperToken which acts as a representation of an underlying ERC20 located on a different chain.
In order to have a common code base independent of the bridge, we add the xERC20 interface to the token contract.
Currently supported bridges
AC
How
The principle was pioneered by the FRACTION token. In that case, the xERC20 interface was implemented in the logic contract, see https://polygonscan.com/address/0xfd5036ace91006ff84918e1884161999099950f0#code.
This pattern however adds maintenance overhead, as a fork of SuperToken with xERC20 added needs to be maintained. Also, SuperToken is already close to the contract size limit. The current FRACTION logic implements just a minimal version of xERC20 (as the interface was smaller at the time of its implementation).
Since targeting use cases of yet-to-be-deployed tokens, we can also implement the xERC20 logic in the proxy contract itself. This avoids the additional maintenance cost of a forked SuperToken logic.
There is a reference implementation at https://github.com/defi-wonderland/xERC20.
The plan is to port the xERC20 specific implementation to this repo, based on PureSuperToken.sol.
The text was updated successfully, but these errors were encountered: