Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FT connector: add more scripts #157

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions erc20-bridge-token/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ task('add-token-to-whitelist-eth', 'Add a token to whitelist')
await BridgeTokenFactory.setTokenWhitelistMode(taskArgs.nearTokenAccount, 2);
});

task('add-account-to-whitelist-eth', 'Add an account to whitelist')
.addParam('nearTokenAccount', 'Near account id of the token')
.addParam('ethAccount', 'Ethereum account address to add it to whitelist')
sept-en marked this conversation as resolved.
Show resolved Hide resolved
.addParam('factory', 'The address of the eth factory contract')
sept-en marked this conversation as resolved.
Show resolved Hide resolved
.setAction(async (taskArgs) => {
const BridgeTokenFactoryContract = await ethers.getContractFactory("BridgeTokenFactory");
const BridgeTokenFactory = BridgeTokenFactoryContract.attach(taskArgs.factory);
const tx = await BridgeTokenFactory.addAccountToWhitelist(taskArgs.nearTokenAccount, taskArgs.ethAccount);
const receipt = await tx.wait();
console.log("Tx hash", receipt.transactionHash);
});

task('withdraw-ft', 'Withdraw bridged tokens from the Ethereum side')
.addParam('factory', 'The address of the eth factory contract')
.addParam('token', 'Near token account id')
Expand Down