Add supported token to Factory

Support a new token on Seadex.

Install Local version

Follow the instructions on Local deployment.

Once you've have the local version, enter into the seadex-contracts container:

$ docker exec -it seadex-contracts bash

Inside the container install module dependencies:

$ npm intall

Then edit the support-token.js to add your supported token:

/home/node/app/scripts/support-token.js
const { ethers } = require('hardhat');

// Pool creator on Seadex. Factory contract deployed on moonriver
const address = "0xD184B1317125b166f01e8a0d6088ce1de61D00BA";
// ERC20 token on moonriver
const SYMBOL = "0xE3C7487Eb01C74b73B7184D198c7fBF46b34E5AF";  

// Deploy function
async function supportToken() {
   [account] = await ethers.getSigners();
   deployerAddress = account.address;
   console.log(`Deploying contracts using ${deployerAddress}`);

   const Factory = await ethers.getContractFactory('UniswapV2Factory');
   const factory = await Factory.attach(address);


   /// Add supported tokens
   await factory.addSupportedToken(WMOVR);
   console.log(`SYMBOL token supported`);
}

supportToken()
   .then(() => process.exit(0))
   .catch((error) => {
      console.error(error);
      process.exit(1);
   });

Once you finished the edition by adding your own factory address: line 4, and your deployed token address on line 6, you can call the hardhat to run script against moonriver blockchain:

npx hardhat run scripts/support-token.js --network moonriver

This will add your token to the list. Now, you can follow Managing Token, to show up token on the interface.

Last updated

Was this helpful?