Skip to content
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

Closed
wants to merge 8 commits into from
Closed

Conversation

ArjunBhuptani
Copy link

@ArjunBhuptani ArjunBhuptani commented Jul 5, 2023

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:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

(Will update PR + this comment once posted to EthMagicians!)

@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-erc labels Jul 5, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Jul 5, 2023

File EIPS/eip-draft_bridged_tokens.md

Requires 1 more reviewers from @axic, @gcolvin, @lightclient, @Pandapip1, @SamWilsn

File EIPS/eip-7281.md

Requires 1 more reviewers from @axic, @Pandapip1, @SamWilsn, @xinbenlv

@eth-bot eth-bot changed the title Add EIP: Bridged Token Standard Add EIP: Bridged Token Standard (xERC20) Jul 5, 2023
@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Jul 5, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jul 5, 2023
@ArjunBhuptani ArjunBhuptani changed the title Add EIP: Bridged Token Standard (xERC20) Add EIP: Bridged Token Standard Jul 5, 2023
@eth-bot eth-bot changed the title Add EIP: Bridged Token Standard Add EIP: Bridged Token Standard (xERC20) Jul 5, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Jul 5, 2023
@ArjunBhuptani ArjunBhuptani changed the title Add EIP: Bridged Token Standard (xERC20) Add EIP: Bridged Token Standard Jul 5, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jul 5, 2023
@@ -0,0 +1,344 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---
---
eip: 7281

Assigning EIP number as PR number. Please also update the file name.

@@ -0,0 +1,344 @@
---
title: Bridged Token Standard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@ArjunBhuptani ArjunBhuptani changed the title Add EIP: Bridged Token Standard Add EIP: Sovereign Bridged Tokens Jul 7, 2023
@eth-bot eth-bot changed the title Add EIP: Sovereign Bridged Tokens Add EIP: Sovereign Bridged Token Jul 7, 2023
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Jul 7, 2023
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
discussions-to: <URL> (TODO)
discussions-to: https://ethereum-magicians.org/t/erc-7281-sovereign-bridged-tokens/14979

@seunlanlege
Copy link

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.
Copy link

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?

Copy link

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"

@github-actions
Copy link

The commit bfc2041 (as a parent of 8ee1407) contains errors.
Please inspect the Run Summary for details.


### 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.
Copy link

@dmuhs dmuhs Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `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 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```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:
Copy link

@dmuhs dmuhs Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link

@emapeire emapeire left a 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).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link appears broken

Suggested change
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).

@SamWilsn
Copy link
Contributor

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.

@radeksvarz
Copy link
Contributor

For all of us landing here: this ERC was migrated to ethereum/ERCs#89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-erc w-ci Waiting on CI to pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.