Skip to content

Commit

Permalink
FT connector: add more scripts (#157)
Browse files Browse the repository at this point in the history
* Add script to add an account to whitelist

Co-authored-by: Kirill <kirill@aurora.dev>
  • Loading branch information
karim-en and sept-en authored Aug 26, 2022
1 parent 876da8f commit 30c9a4a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions erc20-bridge-token/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ task('add-token-to-whitelist-eth', 'Add a token to whitelist')
console.log("Tx hash", receipt.transactionHash);
});

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

0 comments on commit 30c9a4a

Please # to comment.