forked from sushiswap/trident
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
332513c
commit 2498856
Showing
4 changed files
with
15 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { task } from "hardhat/config"; | ||
import { constants } from "ethers"; | ||
import { ERC20Mock } from "../types"; | ||
|
||
const { MaxUint256 } = constants; | ||
|
||
task("erc20:approve", "ERC20 approve") | ||
task("erc20-approve", "ERC20 approve") | ||
.addParam("token", "Token") | ||
.addParam("spender", "Spender") | ||
.setAction(async function ({ token, spender }, { ethers }, runSuper) { | ||
const dev = await ethers.getNamedSigner("dev"); | ||
const erc20 = await ethers.getContractFactory("ERC20Mock"); | ||
|
||
const slp = erc20.attach(token); | ||
|
||
await (await slp.connect(dev).approve(spender, MaxUint256)).wait(); | ||
const erc20 = await ethers.getContractAt<ERC20Mock>("ERC20Mock", token); | ||
return erc20.connect(dev).approve(spender, MaxUint256); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters