Commit 6a2ff743 authored by vicotor's avatar vicotor

update add token

parent 2a13fa70
...@@ -35,13 +35,17 @@ async function getDeploy(chainId) { ...@@ -35,13 +35,17 @@ async function getDeploy(chainId) {
} }
async function setOutConfig(bridge, tokenPair) { async function setOutConfig(bridge, tokenPair) {
const tokenContract = await hre.ethers.getContractAt("TestToken", tokenPair.token);
var decimals = await tokenContract.decimals();
const outConfig = { const outConfig = {
receiveToken: tokenPair.targetToken, receiveToken: tokenPair.targetToken,
fee: hre.ethers.parseEther(tokenPair.fee), fee: hre.ethers.parseUnits(tokenPair.fee, decimals),
limit: hre.ethers.parseEther(tokenPair.limit), limit: hre.ethers.parseUnits(tokenPair.limit, decimals),
isBurn: tokenPair.isBurn, isBurn: tokenPair.isBurn,
enabled: true, enabled: true,
}; };
console.log("set out config for token ", tokenPair.token, "-", outConfig);
var tx = await bridge.changeOutConfig( var tx = await bridge.changeOutConfig(
tokenPair.token, tokenPair.token,
...@@ -61,6 +65,7 @@ async function main() { ...@@ -61,6 +65,7 @@ async function main() {
for (var i = 0; i < tokenPairs.length; i++) { for (var i = 0; i < tokenPairs.length; i++) {
await setOutConfig(curChainDeploy.bridge, tokenPairs[i]); await setOutConfig(curChainDeploy.bridge, tokenPairs[i]);
} }
console.log("all token pairs processed.");
} }
// Run the script // Run the script
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment