Skip to content

Commit

Permalink
refactor: make nonce an immutable var
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 2, 2024
1 parent 15ca0de commit 52da969
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/contracts-rfq/contracts/FastBridgeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {
/// @notice Unique bridge nonces tracked per originSender
mapping(address => uint256) public senderNonces;

// @dev the block the contract was deployed at
/// @notice This is deprecated and should not be used.
/// @dev Replaced by senderNonces
uint256 public immutable nonce = 0;
/// @notice the block the contract was deployed at
uint256 public immutable deployBlock;

constructor(address _owner) Admin(_owner) {
Expand Down Expand Up @@ -112,12 +115,6 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {
return _timeSince(bridgeTxDetails[transactionId].proofBlockTimestamp) > DISPUTE_PERIOD;
}

/// @notice This function is deprecated and should not be used.
/// @dev Replaced by senderNonces
function nonce() external pure returns (uint256) {
return 0;
}

/// @inheritdoc IFastBridge
function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory) {
// Note: when passing V2 request, this will decode the V1 fields correctly since the new fields were
Expand Down

0 comments on commit 52da969

Please sign in to comment.