Skip to content

Commit fc32ba8

Browse files
committed
fix: contract fixes
1 parent 670cc7b commit fc32ba8

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

contracts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ build: build-abi build-bin build-abi-go
22

33
build-abi: src/**
44
mkdir -p abi
5-
forge inspect src/Simulator.sol:Simulator abi --json > abi/Simulator.json
5+
forge inspect contracts/src/Simulator.sol:Simulator abi --json > abi/Simulator.json
66

77
build-bin: src/**
88
forge build --extra-output-files bin --force

contracts/src/Simulator.sol

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,26 +319,33 @@ contract Simulator {
319319

320320
function run_blake2f(uint256 num_iterations) private {
321321
bytes32[2] memory h;
322-
h[0] = 0x48c9bdf267e6096a3ba7ca8485ae67bb2bf894fe72f36e3cf1361d5f3af54fa5;
323-
h[1] = 0xd182e6ad7f520e511f6c3e2b8c68059b6bbd41fbabd9831f79217e1319cde05b;
322+
h[0] = 0xa1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8;
323+
h[1] = 0xa1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8;
324324

325325
bytes32[4] memory m;
326-
m[0] = 0x6162630000000000000000000000000000000000000000000000000000000000;
327-
m[1] = 0x0000000000000000000000000000000000000000000000000000000000000000;
328-
m[2] = 0x0000000000000000000000000000000000000000000000000000000000000000;
329-
m[3] = 0x0000000000000000000000000000000000000000000000000000000000000000;
326+
m[0] = 0xc3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2;
327+
m[1] = 0xc3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2;
328+
m[2] = 0xc3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2;
329+
m[3] = 0xc3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2c3d4e5f6a7b8c1d2;
330330

331331
bytes8[2] memory t;
332-
t[0] = 0x0300000000000000;
333-
t[1] = 0x0000000000000000;
332+
t[0] = 0x0000000000000000;
333+
t[1] = 0x0000000000ff00ff;
334334

335335
bool f = true;
336336

337337
for (uint256 i = 0; i < num_iterations; i++) {
338-
uint32 rounds = uint32(i);
339-
(bool ok,) =
340-
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
341-
require(ok, "Blake2f failed");
338+
uint32 rounds = 0xc00;
339+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
340+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
341+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
342+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
343+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
344+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
345+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
346+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
347+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
348+
address(9).staticcall(abi.encodePacked(rounds, h[0], h[1], m[0], m[1], m[2], m[3], t[0], t[1], f));
342349
}
343350
}
344351

runner/payload/simulator/abi/Simulator.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)