Skip to content

Commit

Permalink
support legacy payload for bascule
Browse files Browse the repository at this point in the history
  • Loading branch information
hashxtree committed Dec 25, 2024
1 parent af6253d commit 0cf838e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions contracts/LBTC/LBTC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -555,17 +555,15 @@ contract LBTC is
/// need to check new sha256 hash and legacy keccak256 from payload without selector
/// 2 checks made to prevent migration of contract state
bytes32 payloadHash = sha256(payload);
if (
$.usedPayloads[payloadHash] ||
$.legacyUsedPayloads[keccak256(payload[4:])]
) {
bytes32 legacyHash = keccak256(payload[4:]);
if ($.usedPayloads[payloadHash] || $.legacyUsedPayloads[legacyHash]) {
revert PayloadAlreadyUsed();
}
Consortium($.consortium).checkProof(payloadHash, proof);
$.usedPayloads[payloadHash] = true;

// Confirm deposit against Bascule
_confirmDeposit($, payloadHash, depositAmount);
_confirmDeposit($, legacyHash, depositAmount);

// Actually mint
_mint(recipient, amountToMint);
Expand Down

0 comments on commit 0cf838e

Please sign in to comment.