Skip to content

Commit

Permalink
Merge branch 'atlas-v1.1' into arbitrum/atlas-v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenSparksCode committed Nov 12, 2024
2 parents 0ae966f + f837859 commit 6642910
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/forge-std
11 changes: 9 additions & 2 deletions src/contracts/atlas/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,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 @@ -225,7 +225,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 @@ -661,11 +661,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 @@ -120,7 +120,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 @@ -165,7 +172,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 @@ -224,7 +238,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 6642910

Please sign in to comment.