Skip to content

Commit

Permalink
fix bug in VirtualPaymentApp
Browse files Browse the repository at this point in the history
Bob's address was hardcoded and only correct for a single intermediary case
  • Loading branch information
geoknee committed Oct 6, 2023
1 parent 5e3ac38 commit 3c19430
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nitro-protocol/contracts/VirtualPaymentApp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ contract VirtualPaymentApp is IForceMoveApp {
if (proof.length == 1) {
requireProofOfUnanimousConsensusOnPostFund(proof[0], fixedPart.participants.length);
require(candidate.variablePart.turnNum == 2, 'bad candidate turnNum; |proof|=1');
uint8 bobIndex = uint8(fixedPart.participants.length - 1);
require(
NitroUtils.isClaimedSignedBy(candidate.signedBy, 2),
NitroUtils.isClaimedSignedBy(candidate.signedBy, bobIndex),
'redemption not signed by Bob'
);
uint256 voucherAmount = requireValidVoucher(candidate.variablePart.appData, fixedPart);
Expand Down

0 comments on commit 3c19430

Please sign in to comment.