Skip to content

Commit

Permalink
Merge pull request #451 from FastLane-Labs/solver-event
Browse files Browse the repository at this point in the history
feat: add indexed dapp control address in solver tx result event
  • Loading branch information
BenSparksCode authored Nov 12, 2024
2 parents 64be23c + 617e8e6 commit f837859
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/forge-std
2 changes: 1 addition & 1 deletion lib/solady
Submodule solady updated 42 files
+10 −11 .github/workflows/ci-all-via-ir.yml
+16 −47 .github/workflows/ci.yml
+1 −4 README.md
+1 −1 foundry.toml
+1 −1 package.json
+0 −58 prep/gen-globalized-libs.js
+0 −2 src/Milady.sol
+2 −2 src/accounts/Pod.sol
+0 −292 src/auth/EnumerableRoles.sol
+40 −164 src/tokens/ERC20.sol
+0 −458 src/tokens/ERC20Votes.sol
+150 −497 src/utils/DynamicArrayLib.sol
+2 −6 src/utils/EnumerableSetLib.sol
+40 −156 src/utils/LibClone.sol
+1 −112 src/utils/LibSort.sol
+354 −349 src/utils/LibString.sol
+3 −3 src/utils/SSTORE2.sol
+68 −50 src/utils/SafeTransferLib.sol
+0 −990 src/utils/g/DynamicArrayLib.sol
+0 −1,317 src/utils/g/DynamicBufferLib.sol
+0 −739 src/utils/g/EnumerableSetLib.sol
+0 −819 src/utils/g/JSONParserLib.sol
+0 −240 src/utils/g/LibBitmap.sol
+0 −318 src/utils/g/LibMap.sol
+0 −505 src/utils/g/LibPRNG.sol
+0 −387 src/utils/g/LibRLP.sol
+0 −572 src/utils/g/MinHeapLib.sol
+0 −721 src/utils/g/RedBlackTreeLib.sol
+2 −254 test/DynamicArrayLib.t.sol
+0 −80 test/ERC20.t.sol
+0 −584 test/ERC20Votes.t.sol
+0 −304 test/EnumerableRoles.t.sol
+0 −50 test/EnumerableSetLib.t.sol
+5 −88 test/LibClone.t.sol
+0 −3 test/LibSort.t.sol
+0 −178 test/LibString.t.sol
+21 −58 test/SafeTransferLib.t.sol
+0 −15 test/utils/TestPlus.sol
+0 −16 test/utils/mocks/MockERC20ForPermit2.sol
+0 −41 test/utils/mocks/MockERC20Votes.sol
+0 −67 test/utils/mocks/MockEnumerableRoles.sol
+0 −4 test/utils/mocks/MockPod.sol
11 changes: 9 additions & 2 deletions src/contracts/atlas/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ abstract contract Escrow is AtlETH {
if (_result.executionSuccessful()) {
// First successful solver call that paid what it bid
emit SolverTxResult(
solverOp.solver, solverOp.from, true, true, _result, bidAmount, solverOp.bidToken
solverOp.solver, solverOp.from, dConfig.to, solverOp.bidToken, bidAmount, true, true, _result
);

ctx.solverSuccessful = true;
Expand All @@ -224,7 +224,14 @@ abstract contract Escrow is AtlETH {
_handleSolverAccounting(solverOp, _gasWaterMark, _result, !prevalidated);

emit SolverTxResult(
solverOp.solver, solverOp.from, _result.executedWithError(), false, _result, bidAmount, solverOp.bidToken
solverOp.solver,
solverOp.from,
dConfig.to,
solverOp.bidToken,
bidAmount,
_result.executedWithError(),
false,
_result
);

return 0;
Expand Down
7 changes: 4 additions & 3 deletions src/contracts/types/AtlasEvents.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ contract AtlasEvents {
event SolverTxResult(
address indexed solverTo,
address indexed solverFrom,
address indexed dAppControl,
address bidToken,
uint256 bidAmount,
bool executed,
bool success,
uint256 result,
uint256 bidAmount,
address bidToken
uint256 result
);

// Factory events
Expand Down
7 changes: 4 additions & 3 deletions test/Escrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,12 @@ contract EscrowTest is BaseTest {
emit AtlasEvents.SolverTxResult(
solverOps[0].solver,
solverOps[0].from,
userOp.control,
solverOps[0].bidToken,
solverOps[0].bidAmount,
solverOpExecuted,
solverOpSuccess,
expectedResult,
solverOps[0].bidAmount,
solverOps[0].bidToken
expectedResult
);

vm.prank(userEOA);
Expand Down
27 changes: 24 additions & 3 deletions test/FlashLoan.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ contract FlashLoanTest is BaseTest {
vm.expectEmit(true, true, true, true);
uint256 result = (1 << uint256(SolverOutcome.BidNotPaid));
emit AtlasEvents.SolverTxResult(
address(solver), solverOneEOA, true, false, result, solverOps[0].bidAmount, solverOps[0].bidToken
address(solver),
solverOneEOA,
userOp.control,
solverOps[0].bidToken,
solverOps[0].bidAmount,
true,
false,
result
);
vm.expectRevert();
atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp });
Expand Down Expand Up @@ -164,7 +171,14 @@ contract FlashLoanTest is BaseTest {
result = (1 << uint256(SolverOutcome.CallValueTooHigh));
console.log("result", result);
emit AtlasEvents.SolverTxResult(
address(solver), solverOneEOA, false, false, result, solverOps[0].bidAmount, solverOps[0].bidToken
address(solver),
solverOneEOA,
userOp.control,
solverOps[0].bidToken,
solverOps[0].bidAmount,
false,
false,
result
);
vm.expectRevert();
atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp });
Expand Down Expand Up @@ -223,7 +237,14 @@ contract FlashLoanTest is BaseTest {
result = 0;
vm.expectEmit(true, true, true, true);
emit AtlasEvents.SolverTxResult(
address(solver), solverOneEOA, true, true, result, solverOps[0].bidAmount, solverOps[0].bidToken
address(solver),
solverOneEOA,
userOp.control,
solverOps[0].bidToken,
solverOps[0].bidAmount,
true,
true,
result
);
atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp });
vm.stopPrank();
Expand Down

0 comments on commit f837859

Please sign in to comment.