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(WIP): Native ERC20 #7

Open
wants to merge 60 commits into
base: main
Choose a base branch
from
Open

feat(WIP): Native ERC20 #7

wants to merge 60 commits into from

Conversation

mationorato
Copy link
Collaborator

@mationorato mationorato commented Dec 1, 2023

What ❔

Replace Ether as the native currency for an ERC20 already available in L1 for a ZK Stack based chain

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.

@ilitteri ilitteri changed the title [WIP] Native ERC20 feat(WIP): Native ERC20 Dec 15, 2023
SantiagoPittella and others added 4 commits December 18, 2023 11:17
* re-add weth step in zk init

* add correct commit hash in contracts submodule

* uncomment steps from init

* update contracts submodule commit

---------

Co-authored-by: Santiago Pittella <[email protected]>
* store native token json in etc/tokens/

* fmt

---------

Co-authored-by: Santiago Pittella <[email protected]>
jrchatruc and others added 17 commits December 22, 2023 15:28
* add methods

* fmt

* add impl

* improve error handling
* Add tool versions for nodejs

* Working ERC20 fetcher draft

* Move code to separate file

* Replace gas price with erc-20 value

* Rename variable

* zk fmt

* Add tool versions for nodejs

* Gas Price RPC changes

* Temporarily remove some debug statements for clearer logs

* Add conversion rate RPC endpoint

* initial commit

* add withdrawal tests

* remove sleeps

* tighten withdraw test

---------

Co-authored-by: Francisco Krause Arnim <[email protected]>
Co-authored-by: Jmunoz <[email protected]>
* set native token env

* rmv try-catch
jrchatruc and others added 11 commits February 2, 2024 12:41
* Add tool versions for nodejs

* Working ERC20 fetcher draft

* Move code to separate file

* Replace gas price with erc-20 value

* Rename variable

* zk fmt

* Add tool versions for nodejs

* Gas Price RPC changes

* Temporarily remove some debug statements for clearer logs

* Add conversion rate RPC endpoint

* initial commit

* add deposit test file

* fmt

* update test

* Add test for not enough balance case

* add test for failing case

* remove native-erc20.test.ts file

---------

Co-authored-by: Francisco Krause Arnim <[email protected]>
Co-authored-by: Jmunoz <[email protected]>
Co-authored-by: Santiago Pittella <[email protected]>
Co-authored-by: Santiago Pittella <[email protected]>
Co-authored-by: Santiago Pittella <[email protected]>
* change contracts submodule

* remove test context restrictions

* deposit eth in context owner

* add non native token integration test

* apply fmt

* update contracts submodule

* wip in tests

* update contracts submodule

* try different l2 addresses

* fix deployL2

* update contracts submodule

* fix l2 weth token init

* try different l2 addresses

* add l2bridge query

* update contracts submodule

* wip

* clean up

* add nonNative tokens for testing, remove l2gasLimit from test

* Pass native erc20 flag to preprocessor

* zk fmt

* fix missing msg.value to amount

* update submodule

* update submodule

* Update submodule

---------

Co-authored-by: Santiago Pittella <[email protected]>
Co-authored-by: Javier Chatruc <[email protected]>
Co-authored-by: Santiago Pittella <[email protected]>
* fix: fix withdraw tests

* chore: zk fmt

* feat: add final check of balance for withdraw test

* Fix tests

---------

Co-authored-by: Javier Chatruc <[email protected]>
…with eth base token (#148)

* feat: rename native (base) token address endpoint

* feat: use 0x...1 when eth is the base token

* chore: cargo fmt
* feat: rename native (base) token address endpoint

* feat: use 0x...1 when eth is the base token

* chore: cargo fmt

* feat: avoid using env var for testing native erc20
fkrause98 pushed a commit that referenced this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants