@arcblock/erc721did-contract 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/cjs/ERC721DID.json +735 -0
- package/lib/cjs/ERC721DIDFactory.json +165 -0
- package/lib/{EvmChainList.json → cjs/EvmChainList.json} +22 -18
- package/lib/{contract.js → cjs/contract.js} +45 -22
- package/lib/esm/ERC721DID.json +735 -0
- package/lib/esm/ERC721DIDFactory.json +165 -0
- package/lib/esm/EvmChainList.json +54 -0
- package/lib/esm/contract.js +1412 -0
- package/package.json +24 -14
- package/lib/ERC721DID.json +0 -725
- package/lib/ERC721DIDFactory.json +0 -155
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "ERC721DIDFactory",
|
|
4
|
+
"sourceName": "src/ERC721DIDFactory.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "address",
|
|
10
|
+
"name": "_implementation",
|
|
11
|
+
"type": "address"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"stateMutability": "nonpayable",
|
|
15
|
+
"type": "constructor"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"anonymous": false,
|
|
19
|
+
"inputs": [
|
|
20
|
+
{
|
|
21
|
+
"indexed": false,
|
|
22
|
+
"internalType": "address",
|
|
23
|
+
"name": "contractAddress",
|
|
24
|
+
"type": "address"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"name": "Created",
|
|
28
|
+
"type": "event"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"anonymous": false,
|
|
32
|
+
"inputs": [
|
|
33
|
+
{
|
|
34
|
+
"indexed": true,
|
|
35
|
+
"internalType": "address",
|
|
36
|
+
"name": "previousOwner",
|
|
37
|
+
"type": "address"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"indexed": true,
|
|
41
|
+
"internalType": "address",
|
|
42
|
+
"name": "newOwner",
|
|
43
|
+
"type": "address"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"name": "OwnershipTransferred",
|
|
47
|
+
"type": "event"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"stateMutability": "nonpayable",
|
|
51
|
+
"type": "fallback"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"internalType": "address",
|
|
57
|
+
"name": "_proxyRegistryAddress",
|
|
58
|
+
"type": "address"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"internalType": "string",
|
|
62
|
+
"name": "_baseImageURI",
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"internalType": "string",
|
|
67
|
+
"name": "_contractName",
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"internalType": "string",
|
|
72
|
+
"name": "_contractSymbol",
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"internalType": "string",
|
|
77
|
+
"name": "_contractDescription",
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"internalType": "uint256",
|
|
82
|
+
"name": "_totalLimit",
|
|
83
|
+
"type": "uint256"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"internalType": "uint256",
|
|
87
|
+
"name": "_price",
|
|
88
|
+
"type": "uint256"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"internalType": "address payable",
|
|
92
|
+
"name": "_transferTokenAddress",
|
|
93
|
+
"type": "address"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"name": "create",
|
|
97
|
+
"outputs": [],
|
|
98
|
+
"stateMutability": "nonpayable",
|
|
99
|
+
"type": "function"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"inputs": [],
|
|
103
|
+
"name": "implementation",
|
|
104
|
+
"outputs": [
|
|
105
|
+
{
|
|
106
|
+
"internalType": "address",
|
|
107
|
+
"name": "",
|
|
108
|
+
"type": "address"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"stateMutability": "view",
|
|
112
|
+
"type": "function"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"inputs": [],
|
|
116
|
+
"name": "owner",
|
|
117
|
+
"outputs": [
|
|
118
|
+
{
|
|
119
|
+
"internalType": "address",
|
|
120
|
+
"name": "",
|
|
121
|
+
"type": "address"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"stateMutability": "view",
|
|
125
|
+
"type": "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"inputs": [],
|
|
129
|
+
"name": "renounceOwnership",
|
|
130
|
+
"outputs": [],
|
|
131
|
+
"stateMutability": "nonpayable",
|
|
132
|
+
"type": "function"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"inputs": [
|
|
136
|
+
{
|
|
137
|
+
"internalType": "address",
|
|
138
|
+
"name": "_implementation",
|
|
139
|
+
"type": "address"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"name": "setImplementation",
|
|
143
|
+
"outputs": [],
|
|
144
|
+
"stateMutability": "nonpayable",
|
|
145
|
+
"type": "function"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"inputs": [
|
|
149
|
+
{
|
|
150
|
+
"internalType": "address",
|
|
151
|
+
"name": "newOwner",
|
|
152
|
+
"type": "address"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"name": "transferOwnership",
|
|
156
|
+
"outputs": [],
|
|
157
|
+
"stateMutability": "nonpayable",
|
|
158
|
+
"type": "function"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"bytecode": "0x608060405234801561001057600080fd5b5060405162000e5638038062000e56833981810160405281019061003491906101c6565b61005061004561009760201b60201c565b61009f60201b60201c565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506101f3565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061019382610168565b9050919050565b6101a381610188565b81146101ae57600080fd5b50565b6000815190506101c08161019a565b92915050565b6000602082840312156101dc576101db610163565b5b60006101ea848285016101b1565b91505092915050565b610c5380620002036000396000f3fe608060405234801561001057600080fd5b50600436106100665760003560e01c80635c60da1b146100a2578063715018a6146100c05780638da5cb5b146100ca578063c137ecd7146100e8578063d784d42614610104578063f2fde38b1461012057610067565b5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610099906105bb565b60405180910390fd5b6100aa61013c565b6040516100b7919061061c565b60405180910390f35b6100c8610162565b005b6100d2610176565b6040516100df919061061c565b60405180910390f35b61010260048036038101906100fd9190610831565b61019f565b005b61011e60048036038101906101199190610957565b610289565b005b61013a60048036038101906101359190610957565b6102d5565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61016a610359565b61017460006103d7565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006101cc600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661049b565b90508073ffffffffffffffffffffffffffffffffffffffff1663f79da28a8a8a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610215989796959493929190610a19565b600060405180830381600087803b15801561022f57600080fd5b505af1158015610243573d6000803e3d6000fd5b505050507f1449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5b81604051610276919061061c565b60405180910390a1505050505050505050565b610291610359565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6102dd610359565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561034d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034490610b25565b60405180910390fd5b610356816103d7565b50565b610361610556565b73ffffffffffffffffffffffffffffffffffffffff1661037f610176565b73ffffffffffffffffffffffffffffffffffffffff16146103d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cc90610b91565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f09050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054890610bfd565b60405180910390fd5b919050565b600033905090565b600082825260208201905092915050565b7f556e6b6e6f772066756e6374696f6e0000000000000000000000000000000000600082015250565b60006105a5600f8361055e565b91506105b08261056f565b602082019050919050565b600060208201905081810360008301526105d481610598565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610606826105db565b9050919050565b610616816105fb565b82525050565b6000602082019050610631600083018461060d565b92915050565b6000604051905090565b600080fd5b600080fd5b610654816105fb565b811461065f57600080fd5b50565b6000813590506106718161064b565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6106ca82610681565b810181811067ffffffffffffffff821117156106e9576106e8610692565b5b80604052505050565b60006106fc610637565b905061070882826106c1565b919050565b600067ffffffffffffffff82111561072857610727610692565b5b61073182610681565b9050602081019050919050565b82818337600083830152505050565b600061076061075b8461070d565b6106f2565b90508281526020810184848401111561077c5761077b61067c565b5b61078784828561073e565b509392505050565b600082601f8301126107a4576107a3610677565b5b81356107b484826020860161074d565b91505092915050565b6000819050919050565b6107d0816107bd565b81146107db57600080fd5b50565b6000813590506107ed816107c7565b92915050565b60006107fe826105db565b9050919050565b61080e816107f3565b811461081957600080fd5b50565b60008135905061082b81610805565b92915050565b600080600080600080600080610100898b03121561085257610851610641565b5b60006108608b828c01610662565b985050602089013567ffffffffffffffff81111561088157610880610646565b5b61088d8b828c0161078f565b975050604089013567ffffffffffffffff8111156108ae576108ad610646565b5b6108ba8b828c0161078f565b965050606089013567ffffffffffffffff8111156108db576108da610646565b5b6108e78b828c0161078f565b955050608089013567ffffffffffffffff81111561090857610907610646565b5b6109148b828c0161078f565b94505060a06109258b828c016107de565b93505060c06109368b828c016107de565b92505060e06109478b828c0161081c565b9150509295985092959890939650565b60006020828403121561096d5761096c610641565b5b600061097b84828501610662565b91505092915050565b600081519050919050565b60005b838110156109ad578082015181840152602081019050610992565b838111156109bc576000848401525b50505050565b60006109cd82610984565b6109d7818561055e565b93506109e781856020860161098f565b6109f081610681565b840191505092915050565b610a04816107bd565b82525050565b610a13816107f3565b82525050565b600061010082019050610a2f600083018b61060d565b8181036020830152610a41818a6109c2565b90508181036040830152610a5581896109c2565b90508181036060830152610a6981886109c2565b90508181036080830152610a7d81876109c2565b9050610a8c60a08301866109fb565b610a9960c08301856109fb565b610aa660e0830184610a0a565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610b0f60268361055e565b9150610b1a82610ab3565b604082019050919050565b60006020820190508181036000830152610b3e81610b02565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610b7b60208361055e565b9150610b8682610b45565b602082019050919050565b60006020820190508181036000830152610baa81610b6e565b9050919050565b7f455243313136373a20637265617465206661696c656400000000000000000000600082015250565b6000610be760168361055e565b9150610bf282610bb1565b602082019050919050565b60006020820190508181036000830152610c1681610bda565b905091905056fea2646970667358221220557868f3e08664e3b092710a8b1628826491347e6b43951266d630d283f43d0064736f6c63430008090033",
|
|
162
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100665760003560e01c80635c60da1b146100a2578063715018a6146100c05780638da5cb5b146100ca578063c137ecd7146100e8578063d784d42614610104578063f2fde38b1461012057610067565b5b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610099906105bb565b60405180910390fd5b6100aa61013c565b6040516100b7919061061c565b60405180910390f35b6100c8610162565b005b6100d2610176565b6040516100df919061061c565b60405180910390f35b61010260048036038101906100fd9190610831565b61019f565b005b61011e60048036038101906101199190610957565b610289565b005b61013a60048036038101906101359190610957565b6102d5565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61016a610359565b61017460006103d7565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006101cc600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661049b565b90508073ffffffffffffffffffffffffffffffffffffffff1663f79da28a8a8a8a8a8a8a8a8a6040518963ffffffff1660e01b8152600401610215989796959493929190610a19565b600060405180830381600087803b15801561022f57600080fd5b505af1158015610243573d6000803e3d6000fd5b505050507f1449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5b81604051610276919061061c565b60405180910390a1505050505050505050565b610291610359565b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6102dd610359565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561034d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034490610b25565b60405180910390fd5b610356816103d7565b50565b610361610556565b73ffffffffffffffffffffffffffffffffffffffff1661037f610176565b73ffffffffffffffffffffffffffffffffffffffff16146103d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103cc90610b91565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000763d602d80600a3d3981f3363d3d373d3d3d363d730000008260601b60e81c176000526e5af43d82803e903d91602b57fd5bf38260781b17602052603760096000f09050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054890610bfd565b60405180910390fd5b919050565b600033905090565b600082825260208201905092915050565b7f556e6b6e6f772066756e6374696f6e0000000000000000000000000000000000600082015250565b60006105a5600f8361055e565b91506105b08261056f565b602082019050919050565b600060208201905081810360008301526105d481610598565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610606826105db565b9050919050565b610616816105fb565b82525050565b6000602082019050610631600083018461060d565b92915050565b6000604051905090565b600080fd5b600080fd5b610654816105fb565b811461065f57600080fd5b50565b6000813590506106718161064b565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6106ca82610681565b810181811067ffffffffffffffff821117156106e9576106e8610692565b5b80604052505050565b60006106fc610637565b905061070882826106c1565b919050565b600067ffffffffffffffff82111561072857610727610692565b5b61073182610681565b9050602081019050919050565b82818337600083830152505050565b600061076061075b8461070d565b6106f2565b90508281526020810184848401111561077c5761077b61067c565b5b61078784828561073e565b509392505050565b600082601f8301126107a4576107a3610677565b5b81356107b484826020860161074d565b91505092915050565b6000819050919050565b6107d0816107bd565b81146107db57600080fd5b50565b6000813590506107ed816107c7565b92915050565b60006107fe826105db565b9050919050565b61080e816107f3565b811461081957600080fd5b50565b60008135905061082b81610805565b92915050565b600080600080600080600080610100898b03121561085257610851610641565b5b60006108608b828c01610662565b985050602089013567ffffffffffffffff81111561088157610880610646565b5b61088d8b828c0161078f565b975050604089013567ffffffffffffffff8111156108ae576108ad610646565b5b6108ba8b828c0161078f565b965050606089013567ffffffffffffffff8111156108db576108da610646565b5b6108e78b828c0161078f565b955050608089013567ffffffffffffffff81111561090857610907610646565b5b6109148b828c0161078f565b94505060a06109258b828c016107de565b93505060c06109368b828c016107de565b92505060e06109478b828c0161081c565b9150509295985092959890939650565b60006020828403121561096d5761096c610641565b5b600061097b84828501610662565b91505092915050565b600081519050919050565b60005b838110156109ad578082015181840152602081019050610992565b838111156109bc576000848401525b50505050565b60006109cd82610984565b6109d7818561055e565b93506109e781856020860161098f565b6109f081610681565b840191505092915050565b610a04816107bd565b82525050565b610a13816107f3565b82525050565b600061010082019050610a2f600083018b61060d565b8181036020830152610a41818a6109c2565b90508181036040830152610a5581896109c2565b90508181036060830152610a6981886109c2565b90508181036080830152610a7d81876109c2565b9050610a8c60a08301866109fb565b610a9960c08301856109fb565b610aa660e0830184610a0a565b9998505050505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610b0f60268361055e565b9150610b1a82610ab3565b604082019050919050565b60006020820190508181036000830152610b3e81610b02565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610b7b60208361055e565b9150610b8682610b45565b602082019050919050565b60006020820190508181036000830152610baa81610b6e565b9050919050565b7f455243313136373a20637265617465206661696c656400000000000000000000600082015250565b6000610be760168361055e565b9150610bf282610bb1565b602082019050919050565b60006020820190508181036000830152610c1681610bda565b905091905056fea2646970667358221220557868f3e08664e3b092710a8b1628826491347e6b43951266d630d283f43d0064736f6c63430008090033",
|
|
163
|
+
"linkReferences": {},
|
|
164
|
+
"deployedLinkReferences": {}
|
|
165
|
+
}
|
|
@@ -2,49 +2,53 @@
|
|
|
2
2
|
{
|
|
3
3
|
"chainId": "5",
|
|
4
4
|
"chainName": "Goerli",
|
|
5
|
-
"contractFactoryAddress": "
|
|
5
|
+
"contractFactoryAddress": "0x4c093eAf8d569f6b2dC5a217D25cb3f0B60918C3",
|
|
6
6
|
"isTest": true,
|
|
7
7
|
"networkName": "goerli",
|
|
8
8
|
"symbol": "ETH (Goerli)",
|
|
9
9
|
"defaultRPC": "https://goerli.infura.io/v3/31276ea517a941c5b91d914fab83494e",
|
|
10
10
|
"explorer": "https://goerli.etherscan.io",
|
|
11
11
|
"icon": "eth",
|
|
12
|
-
"enable": true
|
|
12
|
+
"enable": true,
|
|
13
|
+
"decimal": 18
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
16
|
"chainId": "84531",
|
|
16
17
|
"chainName": "Base Goerli",
|
|
17
|
-
"contractFactoryAddress": "
|
|
18
|
+
"contractFactoryAddress": "0xe83044a18dAb8F28F99F22f413C3856A0e39B153",
|
|
18
19
|
"isTest": true,
|
|
19
20
|
"networkName": "base-goerli",
|
|
20
21
|
"symbol": "ETH (Base Goerli)",
|
|
21
22
|
"defaultRPC": "https://goerli.base.org",
|
|
22
23
|
"explorer": "https://goerli.basescan.org",
|
|
23
24
|
"icon": "base",
|
|
24
|
-
"enable": true
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
"chainId": "11155111",
|
|
28
|
-
"chainName": "Sepolia",
|
|
29
|
-
"contractFactoryAddress": "0xA44112bA00F1a4bc20374C99EC9547C6FA925db7",
|
|
30
|
-
"isTest": true,
|
|
31
|
-
"networkName": "sepolia",
|
|
32
|
-
"symbol": "ETH (Sepolia)",
|
|
33
|
-
"defaultRPC": "https://sepolia.infura.io/v3/31276ea517a941c5b91d914fab83494e",
|
|
34
|
-
"explorer": "https://sepolia.etherscan.io",
|
|
35
|
-
"icon": "eth",
|
|
36
|
-
"enable": false
|
|
25
|
+
"enable": true,
|
|
26
|
+
"decimal": 18
|
|
37
27
|
},
|
|
38
28
|
{
|
|
39
29
|
"chainId": "97",
|
|
40
30
|
"chainName": "BNB (Binance Smart Chain)",
|
|
41
|
-
"contractFactoryAddress": "
|
|
31
|
+
"contractFactoryAddress": "0xf13AAEF9071498eE61D0e6390970e0629c60a53C",
|
|
42
32
|
"isTest": true,
|
|
43
33
|
"networkName": "bsc-test",
|
|
44
34
|
"symbol": "BNB",
|
|
45
35
|
"defaultRPC": "https://bsc.getblock.io/13042277-cdaa-47dc-acda-5a0900eaf4ae/testnet",
|
|
46
36
|
"explorer": "https://testnet.bscscan.com",
|
|
47
37
|
"icon": "bnb",
|
|
48
|
-
"enable": true
|
|
38
|
+
"enable": true,
|
|
39
|
+
"decimal": 18
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"chainId": "11155111",
|
|
43
|
+
"chainName": "Sepolia",
|
|
44
|
+
"contractFactoryAddress": "0xf13AAEF9071498eE61D0e6390970e0629c60a53C",
|
|
45
|
+
"isTest": true,
|
|
46
|
+
"networkName": "sepolia",
|
|
47
|
+
"symbol": "ETH (Sepolia)",
|
|
48
|
+
"defaultRPC": "https://sepolia.infura.io/v3/31276ea517a941c5b91d914fab83494e",
|
|
49
|
+
"explorer": "https://sepolia.etherscan.io",
|
|
50
|
+
"icon": "eth",
|
|
51
|
+
"enable": false,
|
|
52
|
+
"decimal": 18
|
|
49
53
|
}
|
|
50
54
|
]
|
|
@@ -7,10 +7,11 @@ const waitFor = require('p-wait-for');
|
|
|
7
7
|
const { toBase58 } = require('@ocap/util');
|
|
8
8
|
const upperFirst = require('lodash/upperFirst');
|
|
9
9
|
const keyBy = require('lodash/keyBy');
|
|
10
|
+
const pick = require('lodash/pick');
|
|
10
11
|
const ERC721DID = require('./ERC721DID.json');
|
|
11
12
|
const ERC721DIDFactory = require('./ERC721DIDFactory.json');
|
|
12
13
|
|
|
13
|
-
const
|
|
14
|
+
const INFURA_PROJECT_ID = '31276ea517a941c5b91d914fab83494e';
|
|
14
15
|
|
|
15
16
|
const CHAIN_MAP = {
|
|
16
17
|
1: {
|
|
@@ -22,6 +23,7 @@ const CHAIN_MAP = {
|
|
|
22
23
|
explorer: 'https://etherscan.io',
|
|
23
24
|
icon: 'eth',
|
|
24
25
|
enable: true,
|
|
26
|
+
decimal: 18,
|
|
25
27
|
},
|
|
26
28
|
5: {
|
|
27
29
|
networkName: 'goerli',
|
|
@@ -32,6 +34,7 @@ const CHAIN_MAP = {
|
|
|
32
34
|
explorer: 'https://goerli.etherscan.io',
|
|
33
35
|
icon: 'eth',
|
|
34
36
|
enable: true,
|
|
37
|
+
decimal: 18,
|
|
35
38
|
},
|
|
36
39
|
31337: {
|
|
37
40
|
networkName: 'localhost',
|
|
@@ -42,6 +45,7 @@ const CHAIN_MAP = {
|
|
|
42
45
|
explorer: 'http://localhost:8545',
|
|
43
46
|
icon: 'eth',
|
|
44
47
|
enable: true,
|
|
48
|
+
decimal: 18,
|
|
45
49
|
},
|
|
46
50
|
84531: {
|
|
47
51
|
networkName: 'base-goerli',
|
|
@@ -52,6 +56,7 @@ const CHAIN_MAP = {
|
|
|
52
56
|
explorer: 'https://goerli.basescan.org',
|
|
53
57
|
icon: 'base',
|
|
54
58
|
enable: true,
|
|
59
|
+
decimal: 18,
|
|
55
60
|
},
|
|
56
61
|
11155111: {
|
|
57
62
|
networkName: 'sepolia',
|
|
@@ -62,6 +67,7 @@ const CHAIN_MAP = {
|
|
|
62
67
|
explorer: 'https://sepolia.etherscan.io',
|
|
63
68
|
icon: 'eth',
|
|
64
69
|
enable: false, // FIXME
|
|
70
|
+
decimal: 18,
|
|
65
71
|
},
|
|
66
72
|
97: {
|
|
67
73
|
networkName: 'bsc-test',
|
|
@@ -72,6 +78,7 @@ const CHAIN_MAP = {
|
|
|
72
78
|
explorer: 'https://testnet.bscscan.com',
|
|
73
79
|
icon: 'bnb',
|
|
74
80
|
enable: true,
|
|
81
|
+
decimal: 18,
|
|
75
82
|
},
|
|
76
83
|
};
|
|
77
84
|
|
|
@@ -81,7 +88,6 @@ let isLocal = false;
|
|
|
81
88
|
|
|
82
89
|
function getProvider(chainId) {
|
|
83
90
|
const { defaultRPC } = getChainInfo(chainId);
|
|
84
|
-
|
|
85
91
|
return new ethers.providers.JsonRpcProvider(defaultRPC);
|
|
86
92
|
}
|
|
87
93
|
|
|
@@ -130,7 +136,7 @@ async function getGasPrice({ provider }) {
|
|
|
130
136
|
}
|
|
131
137
|
|
|
132
138
|
async function getTxData(params = {}) {
|
|
133
|
-
const { contract, fn, args } = params;
|
|
139
|
+
const { contract, fn, args, value } = params;
|
|
134
140
|
const txData = contract.interface.encodeFunctionData(fn, args);
|
|
135
141
|
|
|
136
142
|
const chainId = await getChainId({ contract });
|
|
@@ -138,10 +144,17 @@ async function getTxData(params = {}) {
|
|
|
138
144
|
// const gasPrice = await getGasPrice({ provider: contract.provider });
|
|
139
145
|
// const gasPriceAsGwei = Math.ceil(ethers.utils.formatUnits(gasPrice, 'gwei').toString());
|
|
140
146
|
|
|
147
|
+
const extraEtherValueMap = value
|
|
148
|
+
? {
|
|
149
|
+
value,
|
|
150
|
+
}
|
|
151
|
+
: {};
|
|
152
|
+
|
|
141
153
|
const gasLimit = await contract.provider
|
|
142
154
|
.estimateGas({
|
|
143
155
|
to: contract.address,
|
|
144
156
|
data: txData,
|
|
157
|
+
...extraEtherValueMap,
|
|
145
158
|
})
|
|
146
159
|
.then((res) => res.toString());
|
|
147
160
|
|
|
@@ -152,6 +165,7 @@ async function getTxData(params = {}) {
|
|
|
152
165
|
tx: {
|
|
153
166
|
to: contract.address,
|
|
154
167
|
value: '0',
|
|
168
|
+
...extraEtherValueMap,
|
|
155
169
|
gasLimit,
|
|
156
170
|
data: txData,
|
|
157
171
|
},
|
|
@@ -265,8 +279,19 @@ const getCloneContractArgs = ({
|
|
|
265
279
|
contractSymbol = '',
|
|
266
280
|
contractDescription,
|
|
267
281
|
totalLimit = 0,
|
|
282
|
+
price = '0',
|
|
283
|
+
transferTokenAddress,
|
|
268
284
|
} = {}) => {
|
|
269
|
-
const params = [
|
|
285
|
+
const params = [
|
|
286
|
+
ownerAddress,
|
|
287
|
+
baseImageURI,
|
|
288
|
+
contractName,
|
|
289
|
+
contractSymbol,
|
|
290
|
+
contractDescription,
|
|
291
|
+
totalLimit,
|
|
292
|
+
price,
|
|
293
|
+
transferTokenAddress || ownerAddress,
|
|
294
|
+
];
|
|
270
295
|
return params;
|
|
271
296
|
};
|
|
272
297
|
|
|
@@ -289,7 +314,7 @@ const getEvmChainList = () => {
|
|
|
289
314
|
// override
|
|
290
315
|
return {
|
|
291
316
|
...item,
|
|
292
|
-
...CUSTOM_CHAIN_MAP[chainId],
|
|
317
|
+
...pick(CUSTOM_CHAIN_MAP[chainId], ['enable', 'defaultRPC', 'explorer']),
|
|
293
318
|
};
|
|
294
319
|
}
|
|
295
320
|
return item;
|
|
@@ -302,20 +327,18 @@ const getEvmChainList = () => {
|
|
|
302
327
|
return [];
|
|
303
328
|
};
|
|
304
329
|
|
|
305
|
-
module.exports =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
getChainIdByChainName,
|
|
321
|
-
};
|
|
330
|
+
module.exports.getContract = getContract;
|
|
331
|
+
module.exports.getContractFactory = getContractFactory;
|
|
332
|
+
module.exports.getTxData = getTxData;
|
|
333
|
+
module.exports.getGasPrice = getGasPrice;
|
|
334
|
+
module.exports.waitForTxReceipt = waitForTxReceipt;
|
|
335
|
+
module.exports.onContractFilter = onContractFilter;
|
|
336
|
+
module.exports.getChainId = getChainId;
|
|
337
|
+
module.exports.getChainInfo = getChainInfo;
|
|
338
|
+
module.exports.getBlockExplorerUrl = getBlockExplorerUrl;
|
|
339
|
+
module.exports.getTxExplorerUrl = getTxExplorerUrl;
|
|
340
|
+
module.exports.getAddressExplorerUrl = getAddressExplorerUrl;
|
|
341
|
+
module.exports.getCloneContractArgs = getCloneContractArgs;
|
|
342
|
+
module.exports.getEvmChainList = getEvmChainList;
|
|
343
|
+
module.exports.setupContractEnv = setupContractEnv;
|
|
344
|
+
module.exports.getChainIdByChainName = getChainIdByChainName;
|