[CTE] Warmup
Warmup
Deploy ( # )
50 points
通過.Call me( # )
컨트랙트
ブロックチェーンネットワークに配備(deployed
).On-Chain
田舎とやり取りする方法が必要です.Hardhat
Hardhat
イーサネット開発環境であり、컨트랙트 컴파일
・Built-in Local Network 제공
など多様な機能を有している.test
機能を使用する.Warmup
フェーズなので、Call me Changeは環境設定フェーズとみなすこともできます.Hardhat
取付hardhat.config.js
エーRopsten
ネットワーク設定追加npx hardhat test --network ropsten
問題解決Alchemy
医API Key 값
医Metamask
医Private Key
値を取得し、hardhat.config.js
で指定する必要があります.hardhat tutorial
など、調べてみればわかります.const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("Call Me Contract", function () {
before( async () => {
const factory = await ethers.getContractFactory("CallMeChallenge")
contract = factory.attach("0x8FA2BEBace3C78492601306035852Ab748179073")
});
it("solves the challenge", async () => {
const tx = await contract.callme();
await tx.wait()
});
});
c0np4nn4@ubuntu:~/Desktop/hardhat-tutorial$ npx hardhat test ./test/callme.js --network ropsten
Call Me Contract
✔ solves the challenge (8626ms)
1 passing (10s)
c0np4nn4@ubuntu:~/Desktop/hardhat-tutorial$
Choose a nickname( # )
const { ethers } = require("hardhat");
const { expect } = require("chai");
describe("Nickname Challenge", function () {
before(async function () {
const factory = await ethers.getContractFactory("CaptureTheEther")
contract = factory.attach(`0x71c46Ed333C35e4E6c62D32dc7C8F00D125b4fee`)
});
it("solves the challenge", async function () {
const myNickname = ethers.utils.formatBytes32String(`p4nn4`);
const tx = await contract.setNickname(myNickname);
});
});
結果
Reference
この問題について([CTE] Warmup), 我々は、より多くの情報をここで見つけました https://velog.io/@c0np4nn4/CTE-Warmupテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol