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

sequencer: ERC20 deposits and bridging #924

Closed
noot opened this issue Apr 4, 2024 · 0 comments · Fixed by #1149
Closed

sequencer: ERC20 deposits and bridging #924

noot opened this issue Apr 4, 2024 · 0 comments · Fixed by #1149
Assignees
Labels
bridging research research task or research required to complete the task sequencer pertaining to the astria-sequencer crate

Comments

@noot
Copy link
Collaborator

noot commented Apr 4, 2024

it would be good to be able to bridge tokens from the sequencer to the evm which are represented as ERC20s (or some other non-native token), as currently, bridged funds are minted as the native token.

considerations:

  • gas cost (paid on the l2 from the sender's account? what if they have no native token?)
  • how does the rollup know the contract/methods associated with the bridged asset? how does mint permissioning work for a bridged token?
@noot noot added sequencer pertaining to the astria-sequencer crate research research task or research required to complete the task bridging labels Apr 4, 2024
@noot noot changed the title sequencer: ERC20 deposits sequencer: ERC20 deposits and bridging Apr 4, 2024
@noot noot self-assigned this Jun 5, 2024
github-merge-queue bot pushed a commit that referenced this issue Jun 7, 2024
## Summary
implement withdrawals of ERC20 tokens that are of type
`AstriaBridgeableERC20` (see implemented contract).

## Background
we want to be able to withdraw ERC20 tokens that are bridged to a
rollup.

## Changes
- implement `AstriaBridgeableERC20` which is a standard `ERC20` contract
with additional functionality for minting (not used by the withdrawer,
implemented/tested here
astriaorg/astria-geth#20) as well as
functionality for withdrawing
- implement `IAstriaWithdrawer` which is implemented by both
`AstriaWithdrawer` and `AstriaMintableERC20`.
- the withdrawer now interacts with a `IAstriaWithdrawer`. both native
assets and ERC20 withdrawals have the same event signatures, so no
additional code was needed for the withdrawer itself.
- to use the withdrawer with an `AstriaBridgeableERC20`, the
`ASTRIA_BRIDGE_WITHDRAWER_ETHEREUM_CONTRACT_ADDRESS` is set to some
`AstriaMintableERC20`, and
`ASTRIA_BRIDGE_WITHDRAWER_ROLLUP_ASSET_DENOMINATION` is set to the
rollup asset's denomination as represented on the sequencer. for
example, if the asset is represented on the sequencer is
`transfer/channel-1/usdc`, that is the rollup asset denomination. the
`name/symbol` of the ERC20 contract are not relevant.
- also update the build script to write the generated abigen contract
bindings to files, this is easier for debugging and unit testing.

## Testing
unit tests

## Related Issues

closes #924
@noot noot closed this as completed in #1149 Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridging research research task or research required to complete the task sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant