-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add EIP: Sovereign Bridged Token #7281
Conversation
File
|
EIPS/eip-draft_bridged_tokens.md
Outdated
@@ -0,0 +1,344 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- | |
--- | |
eip: 7281 |
Assigning EIP number as PR number. Please also update the file name.
EIPS/eip-draft_bridged_tokens.md
Outdated
@@ -0,0 +1,344 @@ | |||
--- | |||
title: Bridged Token Standard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Bridged Token Standard | |
title: Bridged Token |
The title field in the preamble: Should not include the word “standard” or any variation thereof;
https://eips.ethereum.org/EIPS/eip-1
title: Sovereign Bridged Token | ||
description: An interface for creating fungible representations of tokens bridged across domains. | ||
author: Shaito (@0xShaito), Excalibor (@excaliborr), Arjun Bhuptani (@arjunbhuptani) | ||
discussions-to: <URL> (TODO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussions-to: <URL> (TODO) | |
discussions-to: https://ethereum-magicians.org/t/erc-7281-sovereign-bridged-tokens/14979 |
Duplicate #6403 |
|
||
- Celer’s Open Canonical Token Standard proposed a lock-in free standard for bridging tokens to new domains. However, it largely targeted alternative L1s (that don’t already have a canonical bridge) and did not fully solve the fungibility problem. Regardless, Celer’s approach inspired some of the key thinking behind this standard. | ||
- Maker’s Teleport facility allows for minting and burning canonical DAI between domains. While the approach solves for the desirable properties above, it is highly custom to Maker’s architecture and relies on Maker’s own economic security to function. Circle CCTP similarly solves this problem, but using a mechanism that only centralized token issuers can implement. | ||
- Token issuer multi-bridge implementations, e.g. Angle protocol, Frax Ferry, and Threshold Network’s tBTC. These examples solve for some or all of the above desiderata and can be applied more broadly to all tokens if coupled with minor additions for compatibility with existing deployed tokens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
desiderata
Is this a typo, or a word I'm not smart enough to know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
de·sid·er·a·tum (noun) - plural noun: desiderata
something that is needed or wanted.
"integrity was a desideratum"
The commit bfc2041 (as a parent of 8ee1407) contains errors. |
|
||
### Token Interface | ||
|
||
All xERC-20 tokens MUST implement the standard ERC-20 interface. Note that while many of the below functions are inspired by ERC777, implementers are NOT REQUIRED to adhere to the full ERC777 specification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All xERC-20 tokens MUST implement the standard ERC-20 interface. Note that while many of the below functions are inspired by ERC777, implementers are NOT REQUIRED to adhere to the full ERC777 specification. | |
All xERC-20 tokens MUST implement the standard ERC-20 interface. Note that while many of the below functions are inspired by ERC-777, implementers are NOT REQUIRED to adhere to the full ERC-777 specification. |
ERC format fix to make the validator check happy.
* @notice Reverts when a user with too low of a limit tries to call mint/burn | ||
*/ | ||
|
||
error IXERC-20_NotHighEnoughLimits(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error IXERC-20_NotHighEnoughLimits(); | |
error IXERC20_NotHighEnoughLimits(); |
Remove invalid syntax.
``` | ||
|
||
Implementations MUST additionally satisfy the following requirements: | ||
- `mint` MUST check that the caller's current available `limit` is greater than or equal to `_amount` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `mint` MUST check that the caller's current available `limit` is greater than or equal to `_amount` | |
- `mint` MUST check that the caller's current available `limit` is greater than or equal to `_amount` |
Insert blank line around list as required by validator
The lockbox tries to emulate the WETH contract interface as much as possible. Lockboxes MUST implement the following interface: | ||
|
||
```ts | ||
interface IXERC-20Lockbox { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface IXERC-20Lockbox { | |
interface IXERC20Lockbox { |
Fix invalid interface definition syntax.
* @notice Reverts when a user tries to deposit native tokens on a non-native lockbox | ||
*/ | ||
|
||
error IXERC-20Lockbox_NotNative(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error IXERC-20Lockbox_NotNative(); | |
error IXERC20Lockbox_NotNative(); |
Fix invalid interface definition syntax.
* @notice Reverts when a user tries to withdraw and the call fails | ||
*/ | ||
|
||
error IXERC-20Lockbox_WithdrawFailed(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error IXERC-20Lockbox_WithdrawFailed(); | |
error IXERC20Lockbox_WithdrawFailed(); |
Fix invalid interface definition syntax.
``` | ||
|
||
Lockboxes SHOULD additionally implement the following alternative `deposit` function for native (non-ERC-20) assets. | ||
```ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```ts | |
```ts |
Insert newline to make validator happy
### Aggregation | ||
EIP-7281 introduces new dynamics for aggregators that massively improve user safety and experience across chains. | ||
|
||
There are two unsolved mechanism design problems that currently exist around bridge aggregation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two unsolved mechanism design problems that currently exist around bridge aggregation: | |
There are two unsolved mechanism design problems that currently exist around bridge aggregation: | |
Add blank line around list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking very good 🚀
|
||
## Reference Implementation | ||
|
||
You can find a reference implementation and associated test cases [here](https://github.com/defi-wonderland/xTokens/blob/dev/solidity/contracts/XERC-20.sol). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link appears broken
You can find a reference implementation and associated test cases [here](https://github.com/defi-wonderland/xTokens/blob/dev/solidity/contracts/XERC-20.sol). | |
You can find a reference implementation and associated test cases [here](https://github.com/defi-wonderland/xERC20/blob/dev/solidity/contracts/XERC20.sol). |
I am closing this pull request because we are in the process of separating EIPs and ERCs into distinct repositories. Unfortunately, as far as we are aware, GitHub does not provide any tools to ease this migration, so every pull request will need to be re-opened manually. As this is a PR to create / modify an ERC, I will kindly ask you to redirect this to the new repository at ethereum/ERCs. We have prepared a guide to help with the process. If there is relevant history here, please link to this PR from the new pull request. On behalf of the EIP Editors, I apologize for this inconvenience. |
For all of us landing here: this ERC was migrated to ethereum/ERCs#89 |
When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:
(Will update PR + this comment once posted to EthMagicians!)