Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/intents/intents.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { BatchLookupDto } from "./dto/batch-lookup.dto";
import { UserThrottlerGuard } from "./user-throttler.guard";
import {
verifyStellarSignature,
buildAcceptMessage,
buildCancelMessage,
buildFillMessage,
} from "../common/stellar-signature";
Expand Down Expand Up @@ -268,6 +269,9 @@ export class IntentsController {
throw new ForbiddenException("Solver has insufficient bond");
}

// Verify the solver controls the claimed address (mirrors fill()/cancel()).
verifyStellarSignature(dto.solver, buildAcceptMessage(id, dto.solver), dto.signature);

const updated = await this.intentsService.acceptIfOpen(id, dto.solver);
if (!updated) {
const current = await this.intentsService.get(id);
Expand Down Expand Up @@ -463,7 +467,7 @@ export class IntentsController {
})
.sort((a, b) => Number(BigInt(b.dstAmount) - BigInt(a.dstAmount)));

if (dto.intentId && quotes.length > 0) {
if (dto.intentId && targetIntent && quotes.length > 0) {
await this.intentsService.update(dto.intentId, { quotedDstAmount: quotes[0].dstAmount });
}

Expand Down