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: Native erc20 contract fixes #68

Merged
merged 25 commits into from
Feb 14, 2024

Conversation

juan518munoz
Copy link

@juan518munoz juan518munoz commented Jan 25, 2024

What ❔

Change contracts submodule to work with native token implementation alongside ETH

Things to test

(CLI) Check native token y ETH balances:

npm run dev -- wallet balance --chain=local-geth --address=0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE --erc20-address=0xD47a77a7A93c099a451a2c269ea5fB35238dC52c && npm run dev -- wallet balance --chain=local-geth --address=0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE

Expected output:

...
Local GETH Node Balance: 300000000030000000000039999911200551425000003 lambdacoin
...
Local GETH Node Balance: 3125000000000000005.235779057152336709 ETH

(CLI) Deposit native ERC20

npm run dev -- bridge deposit --chain=dockerized-node --token=0xD47a77a7A93c099a451a2c269ea5fB35238dC52c --pk=0xe131bc3f481277a8f73d680d9ba404cc6f959e64296e0914dded403030d4f705 --to=0x25E62AdC9d1BA5541A30814fbd6cf5efd14C129e --amount=0.000001

Expected output:

...
Deposit:
 From: 0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE (L1 Local)
 To: 0x25E62AdC9d1BA5541A30814fbd6cf5efd14C129e (Dockerized local node)
 Amount: 0.000001 lambdacoin

Sending deposit transaction...
NATIVE ERC20 VERSION

Deposit sent:
 Transaction hash: 0xfoo

Sender L1 balance after transaction: XXX lambdacoin

(CLI) Withdraw & withdraw finalize native token

npm run dev -- bridge withdraw --chain=dockerized-node --pk=0xe131bc3f481277a8f73d680d9ba404cc6f959e64296e0914dded403030d4f705 --to=0x25E62AdC9d1BA5541A30814fbd6cf5efd14C129e --amount=0.000001

Expected output:

...
Withdraw:
 From: 0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE (Dockerized local node)
 To: 0x25E62AdC9d1BA5541A30814fbd6cf5efd14C129e (L1 Local)
 Amount: 0.000001 lambdacoin

Sending withdraw transaction...

Withdraw sent:
 Transaction hash: 0xb140c9d6c2002a9b9434653cf6dff7754e08f66a4d4708ab5c51b9b0c66c96c1

Sender L2 balance after transaction: XXX lambdacoin

then witdraw finalize:

npm run dev -- bridge withdraw-finalize --chain=dockerized-node
# tx hash: 0xb140c9d6c2002a9b9434653cf6dff7754e08f66a4d4708ab5c51b9b0c66c96c1
# pk: 0xe131bc3f481277a8f73d680d9ba404cc6f959e64296e0914dded403030d4f705

Expected output:

Withdraw finalize:
 From chain: Dockerized local node
 To chain: L1 Local
 Withdrawal transaction (L2): 0xb140c9d6c2002a9b9434653cf6dff7754e08f66a4d4708ab5c51b9b0c66c96c1
 Finalizer address (L1): 0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE

Checking status of the transaction...
Transaction is ready to be finalized

Sending finalization transaction...

Withdrawal finalized:
 Finalization transaction hash: 0x51fab40d604f681df5766de3f81d80024ad6286431d9d04ea1f7e7fab8babf2c

Waiting for finalization transaction to be mined...
 Finalization transaction was mined in block N

Sender L1 balance after transaction: XXX lambdacoin

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.
  • Spellcheck has been run via zk spellcheck.

@juan518munoz juan518munoz changed the title Native erc20 contract fixes feat: Native erc20 contract fixes Jan 25, 2024
Oppen pushed a commit that referenced this pull request Feb 9, 2024
@jrchatruc jrchatruc marked this pull request as ready for review February 14, 2024 18:21
@jrchatruc jrchatruc merged commit c02e0e4 into native_erc20 Feb 14, 2024
4 of 9 checks passed
@jrchatruc jrchatruc deleted the native_erc20_contract_fixes branch February 14, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants