@@ -2,15 +2,11 @@ pragma cashscript 0.11.3;
22
33/**
44 * @param nameContractBytecode - Partial bytecode of the name contract
5- * @param minWaitTime - Minimum wait time to consider an auction ended
65 * @param creatorIncentivePKH - PKH of the creator incentive
7- * @param tld - TLD of the name
86 */
97contract Factory(
108 bytes nameContractBytecode,
11- int minWaitTime,
129 bytes20 creatorIncentivePKH,
13- bytes tld
1410) {
1511 /**
1612 * This function finalizes a name registration auction by:
@@ -89,9 +85,12 @@ contract Factory(
8985 // Strict value check
9086 require(tx.outputs[2].value == tx.inputs[2].value, "Output 2: name minting NFT satoshi value must match input 2");
9187
92- // Enforcing the relative timelock, the auctionNFT must be atleast `minWaitTime` old
88+ // Enforcing the relative timelock, the auctionNFT must be atleast 4194306 old
9389 // to be considered ended.
94- require(tx.inputs[3].sequenceNumber == minWaitTime, "Input 3: auction NFT sequence number must equal minimum wait time");
90+ // 4194306 is sequence number in time, 2*512 seconds
91+
92+ // TODO: Make this 3 hours
93+ require(tx.inputs[3].sequenceNumber == 4194306, "Input 3: auction NFT sequence number must equal 4194306");
9594
9695 // Extract the PKH and name from the auctionNFT
9796 bytes20 bidderPKH, bytes name = tx.inputs[3].nftCommitment.split(20);
@@ -100,6 +99,7 @@ contract Factory(
10099 int nameLength = name.length;
101100 // category + name + bytecode.
102101 // Note: `inactivityExpiryTime` in the name is already added to the nameContractBytecode in the constructor.
102+ bytes constant tld = bytes('.bch');
103103 bytes nameBytecode = 0x20 + registryInputCategory + bytes(nameLength + tld.length) + name + tld + nameContractBytecode;
104104 bytes32 scriptHash = hash256(nameBytecode);
105105 bytes35 nameLockingBytecode = new LockingBytecodeP2SH32(scriptHash);
0 commit comments