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 compileYou can deploy a proxy with:
export PRIVATE_KEY=<...>
pnpm exec hardhat deployProxy 0x5DD38E64dA8f7d541d8aF45fe00bF37F6a2c6195 --network zq-testnetIf your ZRC-2 is burnable (ie. supports the Burn() transition), you can use:
export PRIVATE_KEY=<...>
pnpm exec hardhat deployProxyBurnable 0x5DD38E64dA8f7d541d8aF45fe00bF37F6a2c6195 --network zq-testnetThe task should automatically verify these contracts to sourcify.
Various networks are available in the hardhat.conf.ts:
zq-testnet- the Zilliqa 1 testnetzq- the Zilliqa 1 mainnetlocal-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 5557To monitor requests.
To run the tests:
export PRIVATE_KEY=<...>
export TEST_KEY_1=<...>
export TEST_KEY_2=<...>
pnpm exec hardhat test --network zq-testnetEach 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-2CACHED_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.