Skip to content

Commit

Permalink
add flight class (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Purva-Chaudhari authored Nov 29, 2024
1 parent dca4a17 commit 5f8fe9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plume/src/Faucet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ contract Faucet is Initializable, UUPSUpgradeable {
}

/// @notice Must pass in a message signed by the owner to call this function
modifier onlySignedByOwner(string calldata token, bytes32 salt, bytes calldata signature) {
modifier onlySignedByOwner(string calldata token, uint256 flightClass, bytes32 salt, bytes calldata signature) {
FaucetStorage storage $ = _getFaucetStorage();
bytes32 message = keccak256(abi.encodePacked(msg.sender, token, salt));
bytes32 message = keccak256(abi.encodePacked(msg.sender, token, flightClass, salt));

if ($.usedNonces[message]) {
revert InvalidNonce();
Expand Down Expand Up @@ -192,9 +192,10 @@ contract Faucet is Initializable, UUPSUpgradeable {
*/
function getToken(
string calldata token,
uint256 flightClass,
bytes32 salt,
bytes calldata signature
) external onlySignedByOwner(token, salt, signature) {
) external onlySignedByOwner(token, flightClass, salt, signature) {
FaucetStorage storage $ = _getFaucetStorage();
address tokenAddress = $.tokens[token];
uint256 amount = $.dripAmounts[tokenAddress];
Expand Down

0 comments on commit 5f8fe9f

Please sign in to comment.