- Clone the repo to your local machine, and change into the new directory
git clone https://github.com/solace-fi/referral-code-generator.git && cd referral-code-generator
- Install dependencies. Good practice to use venv:
python3 -m venv venv
=>source venv/bin/activate
pip install -r requirements.txt
-
Create a .env file, and enter private key and RPC endpoint (example provided in .env.example)
-
In app.py, comment in/out the desired constant values for the chain ID and SolaceCoverProductV2.sol address. Default set for MATIC mainnet (lines 17-18).
-
Run script
Polygon for SolaceCoverProductV2: python app_polygon.py
Mainnet for SolaceCoverProduct: python app_eth_mainnet.py
The script will do the following:
- Generate a random private key, and display it
- Compute and display the EVM public address and referral code associated with the private key
- Create a Solace wallet coverage policy for the script-generated EVM public address