Test Plugins
scripts/deployPluginsTest.js
Last updated
scripts/deployPluginsTest.js
Last updated
This script will deploy a factory that can deploy plugins for QuickSwap LP Farms on Polygon zkEVM.
IMPORTANT
This plugin is for testing purposes and uses mock erc20 tokens.
This contract is not audited and not meant for production.
This script will deploy a plugin factory that can deploy three kinds of test plugins:
LP Plugin: this plugin is for an LP token that earns swap fees.
LP Farm Plugin: this plugin is for an LP token deposited into a farm and earns a farming reward.
Single Stake Plugin: this plugin is for a single token that gets staked to earn a farming reward.
Open the scripts/deployPluginsTest.js file.
Update the settings in the script with the voter address of your core system.
Uncomment the "Deploy Plugin Factory" section in main() of deployPluginsTest.js:
Save the deployPluginsTest.js file.
Run the command in the terminal:
Record the addresses from the console:
Update the getContracts() function with those addresses and uncomment them:
Comment out the "Deploy Plugin Factory" section and uncomment the "Verify Plugin Factory" section in main() of deployPluginsTest.js:
Save the deployPluginsTest.js file.
Run the command in the terminal:
Once you've deployed a plugin once you can start deploying them through a block explorer (eg. etherscan, polygonscan) instead. This step is just used to easily verify the plugins for the first time.
Comment out the "Verify Plugin Factory" section and uncomment the desired plugin deployer function in "3. Deploy Plugin" in main() of deployPluginsTest.js. For example, to do deploy on LP plugin uncomment deployLPPlugin():
You can only deploy one type of plugin at a time. Select the parameters for the plugin:
Save the deployPluginsTest.js file.
Run the command in the terminal:
Record the addresses from the console:
Update the getContracts() function with those addresses and uncomment them:
Comment out the "Deploy Plugin" section and uncomment the "Verify Plugin" section in main() of deployPluginsTest.js:
Save the deployPluginsTest.js file.
Run the command in the terminal:
The plugin has been deployed but it is not yet part of the voting system. The final step is to add the plugin to the voter. This can be done through a block explorer (eg. etherscan, polygonscan) if the team wallet is an EOA. It can also be done through gnosis safe contract interactions if the team wallet is a multisig. And finally VTOKEN holders can add it through a proposal in tally.