@@ -7,56 +7,7 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
77import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol " ;
88
99/// @notice Integration tests for BuilderCodes operations
10- contract BuilderCodesOperationsTest is BuilderCodesTest {
11- /// @notice Test that transferred code preserves the payout address
12- ///
13- /// @param codeSeed The seed for generating the code
14- /// @param initialOwner The initial owner address
15- /// @param payoutAddress The payout address
16- /// @param secondOwner The second owner address
17- /// @param newPayoutAddress The new payout address for testing updates
18- function test_transferedCodePreservesPayoutAddress (
19- uint256 codeSeed ,
20- address initialOwner ,
21- address payoutAddress ,
22- address secondOwner ,
23- address newPayoutAddress
24- ) public {
25- initialOwner = _boundNonZeroAddress (initialOwner);
26- payoutAddress = _boundNonZeroAddress (payoutAddress);
27- secondOwner = _boundNonZeroAddress (secondOwner);
28- newPayoutAddress = _boundNonZeroAddress (newPayoutAddress);
29-
30- vm.assume (initialOwner != secondOwner);
31-
32- string memory code = _generateValidCode (codeSeed);
33-
34- // Register the code with initial owner and payout address
35- vm.prank (registrar);
36- builderCodes.register (code, initialOwner, payoutAddress);
37-
38- // Verify initial state
39- uint256 tokenId = builderCodes.toTokenId (code);
40- assertEq (builderCodes.ownerOf (tokenId), initialOwner);
41- assertEq (builderCodes.payoutAddress (code), payoutAddress);
42-
43- // Transfer the code to second owner
44- vm.prank (owner);
45- builderCodes.grantRole (TRANSFER_ROLE, initialOwner);
46- vm.prank (initialOwner);
47- builderCodes.transferFrom (initialOwner, secondOwner, tokenId);
48-
49- // Verify ownership changed but payout address preserved
50- assertEq (builderCodes.ownerOf (tokenId), secondOwner);
51- assertEq (builderCodes.payoutAddress (code), payoutAddress, "Payout address should be preserved after transfer " );
52-
53- // Verify new owner can update payout address
54- vm.prank (secondOwner);
55- builderCodes.updatePayoutAddress (code, newPayoutAddress);
56-
57- assertEq (builderCodes.payoutAddress (code), newPayoutAddress);
58- }
59-
10+ contract BuilderCodesAdminOperationsTest is BuilderCodesTest {
6011 /// @notice Test that adding many registrars works
6112 ///
6213 /// @param testOwner The owner address for testing
0 commit comments