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

feat(withdrawer): bridged ERC20 token withdrawals #1149

Merged
merged 25 commits into from
Jun 7, 2024
Merged

Conversation

noot
Copy link
Collaborator

@noot noot commented Jun 5, 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 implement AstriaMintableERC20, update deposit tx to support ERC20 mints 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 requested review from a team, joroshiba and SuperFluffy as code owners June 5, 2024 04:03
@noot noot requested a review from a team as a code owner June 5, 2024 22:28
@github-actions github-actions bot added the ci issues that are related to ci and github workflows label Jun 5, 2024
Copy link
Member

Choose a reason for hiding this comment

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

nit: add new generated file type locations into .gitattributes file, we should probably do this with the json attribute files as well?

crates/astria-bridge-withdrawer/build.rs Show resolved Hide resolved
@noot noot requested a review from a team as a code owner June 7, 2024 02:23
@noot noot requested a review from joroshiba June 7, 2024 02:23
@noot noot added this pull request to the merge queue Jun 7, 2024
Merged via the queue into main with commit b52a824 Jun 7, 2024
38 checks passed
@noot noot deleted the noot/erc20-withdrawal branch June 7, 2024 18:33
steezeburger added a commit that referenced this pull request Jun 10, 2024
* main:
  fix: ignore RUSTSEC-2021-0139 (#1171)
  chore(sequencer-relayer)!: remove functionality to restrict relaying blocks to only those proposed by a given validator (#1168)
  chore(metrics): update `metric_name` macro to handle a collection of names (#1163)
  fix(bridge-withdrawer): skip linting generated contract code (#1172)
  fix(core, sequencer): prefix removal source non-refund ics20 packet (#1162)
  chore(docs): add sequencer-relayer doc to specs (#1126)
  feat(bridge-withdrawer): sync logic (#1165)
  chore(withdrawer): replace contracts with `astria-bridge-contracts` submodule (#1164)
  feat(sequencer)!: implement bridge sudo and withdrawer addresses (#1142)
  feat(sequencer): implement refund to rollup logic upon ics20 transfer refund (#1161)
  feat(bridge-withdrawer): bridge withdrawer startup (#1160)
  feat(core, proto)!: add bech32m addresses (#1124)
  feat(withdrawer): bridged ERC20 token withdrawals (#1149)
  feat(sequencer-relayer)!: add chain IDs for sequencer and Celestia to config env vars (#1063)
  test(bridge-withdrawer): add submitter tests (#1133)
  chore: bump penumbra deps (#1159)
  feat(sequencer): implement `bridge/account_last_tx_hash` abci query (#1158)
  fix(withdrawer): use block subscription in batcher; send to destination_chain_address (#1157)
  fix(withdrawer): update AstriaWithdrawer to check that withdrawal value is sufficient (#1148)
  chore(ci): build bridge withdrawer images (#1156)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridging ci issues that are related to ci and github workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sequencer: ERC20 deposits and bridging
3 participants