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 all commits
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 to whitelist')
.addParam('factory', 'The address of the factory contract on Ethereum')
.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