-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtalk-w-woojong.sol
56 lines (54 loc) · 1.48 KB
/
talk-w-woojong.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*Decisions:
- fixed price auction
- choose which charitygroup you buy from (4 total)
- 1968*4 total batons
- not going to see metadata when minting, but will be revealed later
- minimize gas costs
- minimize potential for confusion
*/
// tokenId (order minted) ≠ batonId (after shuffle - an asset)
// assumption: we can ask Glenn's team to order the assets
// however we want
/**
"Stored data" method
Easier to reason about & more flexible,
but takes more storage (1968*4 structs)
*/
BatonInfo[1968*4] batonInfo;
BatonInfo {
uint256 charityGroupIndex;
uint8 evolutionState;
uint256
}
mint(uin256 charityId) {
uint256 tokenId = totalSupply();
batonInfo.push(BatonInfo({charityId, 0, }))
mint(tokenId, msg.sender);
}
function batonId(uint256 tokenId) {
return batonInfo[tokenId].batonId;
}
function revealMetadata(string ipfs_base) {
uint256 offset = chainlinkVRF() % (1968 * 4);
}
/**
"Arithmetic" method
Obtuse but doesn't need as much storage
*/
address[4] paymentSplitters;
function mint(uint256 charityId) {
require( 0 <= charityId < 4);
}
function revealMetadata(string ipfs_base) {
uint256 offset = chainlinkVRF() % 1968;
}
function batonId(uint256 tokenId) {
uint256 charityGroup = tokenId / 1968;
uint256 groupOffset = (tokenId + offset) % 1968
uint256 batonId = charityGroup * 1968 + groupOffset;
}
function donate(uint256 tokenId) {
}
function tokenURI(uint256 tokenId) {
return ipfs_base + batonId(tokenId).toString()
}