diff --git a/src/PuzzleBox.sol b/src/PuzzleBox.sol index 75dde6f..0371d74 100644 --- a/src/PuzzleBox.sol +++ b/src/PuzzleBox.sol @@ -92,7 +92,8 @@ contract PuzzleBox { } modifier maxCallDataSize(uint256 maxBytes) { - // console.log('msg.data.length', msg.data.length); + console.log('msg.data.length', msg.data.length); + console.logBytes(msg.data); require(msg.data.length <= maxBytes, 'call data too large'); _; } diff --git a/src/PuzzleBoxSolution_V0.sol b/src/PuzzleBoxSolution_V0.sol index fa7e592..d942e16 100644 --- a/src/PuzzleBoxSolution_V0.sol +++ b/src/PuzzleBoxSolution_V0.sol @@ -27,10 +27,17 @@ contract PuzzleBoxSolution_V0 is Test { inputArray[4] = 8; inputArray[5] = 9; bytes memory encodedDripIds = abi.encode(inputArray); + console.logBytes(encodedDripIds); + + // 0x20 6 2 4 6 7 8 9 + // 0x20 0x100 0x20 6 2 4 6 7 8 9 + + // (bool success,) = address(puzzle).call(abi.encodeWithSelector(puzzle.torch.selector, encodedDripIds)); + // require(success, "call failed"); (bool success,) = address(puzzle).call(abi.encodePacked( puzzle.torch.selector, uint256(0x01), uint8(0), encodedDripIds)); - require(success, "call failed"); + require(success, "call failed"); address payable[] memory friends = new address payable[](1); uint256[] memory friendsCutBps = new uint256[](3); diff --git a/test/PuzzleBox.t.sol b/test/PuzzleBox.t.sol index dc7257e..2ebb6e7 100644 --- a/test/PuzzleBox.t.sol +++ b/test/PuzzleBox.t.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.19; import "forge-std/Test.sol"; import "../src/PuzzleBox.sol"; -import "../src/PuzzleBoxSolution_V2.sol"; +import "../src/PuzzleBoxSolution_V0.sol"; contract PuzzleBoxFixture is Test { event Lock(bytes4 selector, bool isLocked); @@ -18,7 +18,7 @@ contract PuzzleBoxFixture is Test { PuzzleBoxFactory _factory = new PuzzleBoxFactory(); PuzzleBox _puzzle; - PuzzleBoxSolution_V2 _solution; + PuzzleBoxSolution_V0 _solution; // address deployer; // Use a modifier instead of setUp() to keep it all in one tx. @@ -27,7 +27,7 @@ contract PuzzleBoxFixture is Test { // vm.deal(deployer, 1 ether); // vm.startPrank(deployer); _puzzle = _factory.createPuzzleBox{value: 1337}(); - _solution = PuzzleBoxSolution_V2(address(new SolutionContainer(type(PuzzleBoxSolution_V2).runtimeCode))); + _solution = PuzzleBoxSolution_V0(address(new SolutionContainer(type(PuzzleBoxSolution_V0).runtimeCode))); _; }