Test Plugins
scripts/deployPluginsTest.js
This script will deploy a factory that can deploy plugins for QuickSwap LP Farms on Polygon zkEVM.
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.
Plugin Factory: contracts/plugins/local/MockPluginFactory.sol
1. Settings
Open the scripts/deployPluginsTest.js file.
Update the settings in the script with the voter address of your core system.

2. Deploy Plugin Factory
Uncomment the "Deploy Plugin Factory" section in main() of deployPluginsTest.js:

Save the deployPluginsTest.js file.
Run the command in the terminal:
yarn deployTestPlugins
Record the addresses from the console:

Update the getContracts() function with those addresses and uncomment them:

3. Verify Plugin Factory
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:
yarn deployTestPlugins
4. Deploy a Plugin
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:
LP Plugin
A: Symbol of the LP token // LP-TEST0/TEST1
B: Symbol of token0 in the LP // TEST0
C: Symbol of token1 in the LP // TEST1

LP Farm Plugin
A: Symbol of the LP token // LP-TEST0/TEST1
B: Symbol of token0 in the LP // TEST0
C: Symbol of token1 in the LP // TEST1
D: Symbol of farm reward token // RWRD0

Single Stake Plugin
A: Symbol of token // TEST0
B: Symbol of reward // TEST1
* B should never be the same as A

Save the deployPluginsTest.js file.
Run the command in the terminal:
yarn deployTestPlugins
Record the addresses from the console:

Update the getContracts() function with those addresses and uncomment them:

5. Verify the Plugin
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:
yarn deployTestPlugins
6. Add the plugin to the voter
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.

Last updated