Skip to content

Commit a88becd

Browse files
committed
Add study notes for 2025-08-14
1 parent ef5a166 commit a88becd

1 file changed

Lines changed: 119 additions & 0 deletions

File tree

Unjourclair.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,125 @@ timezone: UTC+8
1515
## Notes
1616

1717
<!-- Content_START -->
18+
# 2025-08-14
19+
20+
笔记:ERC721.sol:ERC721标准的实现,提供NFT核心功能,如所有权管理、转移等。
21+
ERC721URIStorage.sol:扩展功能,用于存储每个NFT的元数据URI(如指向JSON文件的链接,包含图片、描述等)。
22+
ERC721Burnable.sol:添加“销毁”功能,允许永久删除NFT,减少流通量。
23+
Ownable.sol:实现访问控制,限制特定功能(如铸造)仅限合约拥有者调用。
24+
EIP712.sol:支持EIP-712标准,用于结构化数据签名,可实现无gas交易(如签名授权)。
25+
ERC721Votes.sol:为NFT添加治理功能,允许NFT持有者参与投票(如DAO治理)。
26+
基于OpenZeppelin的ERC721智能合约MyERC721Token
27+
部署脚本:// SPDX-License-Identifier: UNLICENSED
28+
pragma solidity ^0.8.13;
29+
30+
import {Script, console} from"forge-std/Script.sol";
31+
import {MyERC721Token} from"../src/MyERC721Token.sol";
32+
33+
contract MyERC721TokenScript is Script {
34+
MyERC721Token public my721token;
35+
36+
function setUp() public {}
37+
38+
function run() public {
39+
vm.startBroadcast();
40+
41+
my721token = new MyERC721Token(msg.sender);
42+
console.log("MyERC721Token deployed to:", address(my721token));
43+
44+
vm.stopBroadcast();
45+
}
46+
}
47+
部署合约
48+
NFTMarketHub on  main [!?] via ⬢ v22.1.0 via 🅒 base took 1m 18.6s
49+
➜ source .env
50+
51+
NFTMarketHub on  main [!?] via ⬢ v22.1.0 via 🅒 base
52+
➜ forge script --chain sepolia script/MyERC721Token.s.sol:MyERC721TokenScript --rpc-url $SEPOLIA_RPC_URL --broadcast --account MetaMask --verify -vvvv
53+
54+
[] Compiling...
55+
[] Compiling 1 files with Solc 0.8.20
56+
[] Solc 0.8.20 finished in 1.44s
57+
Compiler run successful!
58+
Enter keystore password:
59+
Traces:
60+
[2119248] MyERC721TokenScript::run()
61+
├─ [0] VM::startBroadcast()
62+
│ └─ ← [Return]
63+
├─ [2072840] → new MyERC721Token@0xC39B0eE94143C457449e16829837FD59d722933C
64+
│ ├─ emit OwnershipTransferred(previousOwner: 0x0000000000000000000000000000000000000000, newOwner: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
65+
│ └─ ← [Return] 10002 bytes of code
66+
├─ [0] console::log("MyERC721Token deployed to:", MyERC721Token: [0xC39B0eE94143C457449e16829837FD59d722933C]) [staticcall]
67+
│ └─ ← [Stop]
68+
├─ [0] VM::stopBroadcast()
69+
│ └─ ← [Return]
70+
└─ ← [Stop]
71+
72+
73+
Script ran successfully.
74+
75+
== Logs ==
76+
MyERC721Token deployed to: 0xC39B0eE94143C457449e16829837FD59d722933C
77+
78+
## Setting up 1 EVM.
79+
==========================
80+
Simulated On-chain Traces:
81+
82+
[2072840] → new MyERC721Token@0xC39B0eE94143C457449e16829837FD59d722933C
83+
├─ emit OwnershipTransferred(previousOwner: 0x0000000000000000000000000000000000000000, newOwner: DefaultSender: [0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38])
84+
└─ ← [Return] 10002 bytes of code
85+
86+
87+
==========================
88+
89+
Chain 11155111
90+
91+
Estimated gas price: 10.85383427 gwei
92+
93+
Estimated total gas used for script: 2990587
94+
95+
Estimated amount required: 0.03245933566801649 ETH
96+
97+
==========================
98+
99+
##### sepolia
100+
[Success]Hash: 0x8e5b0e3a9df4e5231b88d28af9c0e6e903bf7afac027a2ee54bf5faaf67b40c0
101+
Contract Address: 0xC39B0eE94143C457449e16829837FD59d722933C
102+
Block: 6326900
103+
Paid: 0.012441733790006772 ETH (2301162 gas * 5.406717906 gwei)
104+
105+
✅ Sequence #1 on sepolia | Total Paid: 0.012441733790006772 ETH (2301162 gas * avg 5.406717906 gwei)
106+
107+
108+
==========================
109+
110+
ONCHAIN EXECUTION COMPLETE & SUCCESSFUL.
111+
##
112+
Start verification for (1) contracts
113+
Start verifying contract `0xC39B0eE94143C457449e16829837FD59d722933C` deployed on sepolia
114+
115+
Submitting verification for [src/MyERC721Token.sol:MyERC721Token] 0xC39B0eE94143C457449e16829837FD59d722933C.
116+
117+
Submitting verification for [src/MyERC721Token.sol:MyERC721Token] 0xC39B0eE94143C457449e16829837FD59d722933C.
118+
119+
Submitting verification for [src/MyERC721Token.sol:MyERC721Token] 0xC39B0eE94143C457449e16829837FD59d722933C.
120+
Submitted contract for verification:
121+
Response: `OK`
122+
GUID: `q1v8v6kswcqvnzfdifksth4hdk1ss7ukejzxxfuktumivdrr5e`
123+
URL: https://sepolia.etherscan.io/address/0xc39b0ee94143c457449e16829837fd59d722933c
124+
Contract verification status:
125+
Response: `NOTOK`
126+
Details: `Pending in queue`
127+
Contract verification status:
128+
Response: `OK`
129+
Details: `Pass - Verified`
130+
Contract successfully verified
131+
All (1) contracts were verified!
132+
133+
Transactions saved to: /Users/qiaopengjun/Code/solidity-code/NFTMarketHub/broadcast/MyERC721Token.s.sol/11155111/run-latest.json
134+
135+
Sensitive values saved to: /Users/qiaopengjun/Code/solidity-code/NFTMarketHub/cache/MyERC721Token.s.sol/11155111/run-latest.json
136+
18137
# 2025-08-13
19138

20139
运营笔记:活动宣发/活动执行/workshop筹备/Openday筹备/黑客松筹备

0 commit comments

Comments
 (0)