Picasso Referal enables user referals on picasso exchange.
- Picasso admin sends a
createInfluencertransaction toPicassoReferal.solon Polygon chain to Add/Create Influencer with influencer details like referalCode, influencerName, influencerAddress. - By default, referals are disabled for new influencers.
- Picasso admin sends a
enableReferealstransaction toPicassoReferal.solto enable referals for a referal code. - Onboarding of Influencer is completed.
- Influencer shares referal link with his users.
- when user clicks referal link, he is navigated to picasso exchange website and asked to connect wallet.
- Once user clicks connect wallet, a POST call is send to AWS lambda function.
- AWS lamda function sends a
referUsertransaction toPicassoReferal.solpassingreferalCodeanduserAddress. Upon which the smart contract will add influencer address as the fee_reciepeint for this user.
- When user clicks on
ConnectWalleton picasso exchange, we make agetFeeRecepientcall with userAddres toPicassoReferal.soland set it on exchange.
- Clone
git clone https://github.com/PicassoExchange/picasso-referal - Install -
cd picasso-referal && make install - Configure -
Create .env file with required config. Refer to .env.example - Run -
picasso-referal refer-user
picasso-referals refer-user --help
picasso-referal config envname local appLogLevel debug
Usage: picasso-referal refer-user [OPTIONS]
Start user referals
Options:
--eth-chain-id Specify Chain ID of the Ethereum network. (env $ETH_CHAIN_ID) (default 80001)
--eth-node-http Specify HTTP endpoint for an Ethereum node. (env $ETH_RPC) (default "https://rpc-mumbai.matic.today")
--eth_gas_price_adjustment gas price adjustment for Ethereum transactions (env $ETH_GAS_PRICE_ADJUSTMENT) (default 1.3)
--eth-keystore-dir Specify Ethereum keystore dir (Geth-format) prefix. (env $ETH_KEYSTORE_DIR)
--eth-from Specify the from address. If specified, must exist in keystore, ledger or match the privkey. (env $ETH_FROM)
--eth-passphrase Passphrase to unlock the private key from armor, if empty then stdin is used. (env $ETH_PASSPHRASE)
--eth-pk Provide a raw Ethereum private key of the validator in hex. USE FOR TESTING ONLY! (env $ETH_PK)
--eth-use-ledger Use the Ethereum app on hardware ledger to sign transactions. (env $ETH_USE_LEDGER)
--picasso-referal-contract Specify the Picasso Referal contract address. (env $ETH_PICASSO_REFERAL_CONTRACT)