Skip to content

Plunderswap/zrc2proxy

Repository files navigation

ERC20ProxyForZRC2 Contract

NOTE this is an unedited fork from https://github.com/Zilliqa/zilliqa-developer/tree/c9a723dfdd0555b4876de83562c63950301d3ea6/contracts/experimental/ERC20ProxyForZRC2

This repo was created before zilliqa-developer existed. the zrc2 proxy is written by Zilliqa.

If you want to create ZRC2 proxies, fork the official one.

NOTE: if using windows, use WSL.

These contracts allow ZRC-2 tokens to look like ERC-20 tokens.

Unless you want to build using the zilliqa-developer version of zilliqa-js, or you encounter missing modules issues while running tests, install our dependencies with:

pnpm --ignore-workspace i
pnpm exec hardhat compile

Deploying a proxy

You can deploy a proxy with:

export PRIVATE_KEY=<...>
pnpm exec hardhat deployProxy 0x5DD38E64dA8f7d541d8aF45fe00bF37F6a2c6195 --network zq-testnet

If your ZRC-2 is burnable (ie. supports the Burn() transition), you can use:

export PRIVATE_KEY=<...>
pnpm exec hardhat deployProxyBurnable 0x5DD38E64dA8f7d541d8aF45fe00bF37F6a2c6195 --network zq-testnet

The task should automatically verify these contracts to sourcify.

Networks

Various networks are available in the hardhat.conf.ts:

  • zq-testnet - the Zilliqa 1 testnet
  • zq - the Zilliqa 1 mainnet
  • local-proxy - a local proxy.

You can use the local-proxy network and run:

mitmweb --mode reverse:https://dev-api.zilliqa.com --no-web-open-browser --listen-port 5556 --web-port 5557

To monitor requests.

Testing

To run the tests:

export PRIVATE_KEY=<...>
export TEST_KEY_1=<...>
export TEST_KEY_2=<...>
pnpm exec hardhat test --network zq-testnet

Each test has a number prefix so you can select them individually.

If you set the CACHED environment variable, we will use:

  • CACHED_ZRC2 - address of a ZRC-2
  • CACHED_ERC20 - address of an ERC-20

To run the tests; this saves you having to redeploy each time.

This allows you to run tests quickly, without waiting for contract deployment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors