-
Notifications
You must be signed in to change notification settings - Fork 3
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
e90a582
commit f02cca6
Showing
4 changed files
with
55 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { task } from "hardhat/config"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { loadDeployedContractAddresses } from "../../helpers/deploy/contractsJsonHelper"; | ||
|
||
/** | ||
* 【Task】execute bigbang method | ||
*/ | ||
task("bigbang", "bigbang") | ||
.addParam("owner", "The address of the user who will own the topHat.") | ||
.addParam("tophatdetails", "The details of the topHat.") | ||
.addParam("tophatimageuri", "The image URI of the topHat.") | ||
.addParam("hatterhatdetails", "The details of the hatterHat.") | ||
.addParam("hatterhatimageuri", "The image URI of the hatterHat.") | ||
.addParam("forwarder", "The address of the trusted forwarder.") | ||
.setAction(async (taskArgs: any, hre: HardhatRuntimeEnvironment) => { | ||
console.log( | ||
"################################### [START] ###################################" | ||
); | ||
const [bobWalletClient] = await hre.viem.getWalletClients(); | ||
|
||
// BigBangコントラクトのアドレスをjsonファイルから取得してくる。 | ||
const { | ||
contracts: { BigBang }, | ||
} = loadDeployedContractAddresses(hre.network.name); | ||
|
||
// create BigBang instance | ||
const bigbang = await hre.viem.getContractAt("BigBang", BigBang); | ||
|
||
// call bigbang method | ||
const tx = await bigbang.write.bigbang([ | ||
bobWalletClient.account?.address!, | ||
taskArgs.tophatdetails, | ||
taskArgs.tophatimageuri, | ||
taskArgs.hatterhatdetails, | ||
taskArgs.hatterhatimageuri, | ||
taskArgs.forwarder, | ||
]); | ||
|
||
console.log(`tx: ${tx}`); | ||
|
||
console.log( | ||
"################################### [END] ###################################" | ||
); | ||
}); |