Skip to content

Commit

Permalink
Adds the context behaviour to MarketplaceFastDeploymentRequestsFacet.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesduncombe committed Feb 7, 2024
1 parent 58c46db commit 8b96a43
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions contracts/marketplace/MarketplaceFastDeploymentRequestsFacet.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "../common/AHasContext.sol";
import "../common/AHasForwarder.sol";
import "./lib/AMarketplaceFacet.sol";
import "./lib/LibMarketplaceFastDeploymentRequests.sol";

/**
* @title The Marketplace Smart Contract.
* @notice The Marketplace Fast Deployments facet is in charge of keeping track of requested Fast Deployments.
*/
contract MarketplaceFastDeploymentRequestsFacet is AMarketplaceFacet {
contract MarketplaceFastDeploymentRequestsFacet is AMarketplaceFacet, AHasContext {

/// AHasContext implementation.

function _isTrustedForwarder(address forwarder) internal view override(AHasContext) returns (bool) {
return AHasForwarder(address(this)).isTrustedForwarder(forwarder);
}

/**
* @notice Allows querying the current price for a FAST deployment request.
* @return An uint256 representing the price for a FAST deployment request.
Expand Down Expand Up @@ -53,7 +62,7 @@ contract MarketplaceFastDeploymentRequestsFacet is AMarketplaceFacet {
* @notice This function allows users to request a FAST deployment.
* @param params The parameters for the FAST deployment.
*/
function requestDeployment(string memory params) external payable onlyMember(msg.sender) {
function requestDeployment(string memory params) external payable onlyMember(_msgSender()) {
// Grab a pointer to our storage slot.
LibRequestedFastDeployments.Data storage data = LibRequestedFastDeployments.data();
// Not enough attached Eth.
Expand All @@ -63,6 +72,6 @@ contract MarketplaceFastDeploymentRequestsFacet is AMarketplaceFacet {
// Emit!
emit FastDeploymentRequested(data.requests.length);
// Enqueue the request.
data.requests.push(LibRequestedFastDeployments.Request({sender: msg.sender, paid: data.price, params: params}));
data.requests.push(LibRequestedFastDeployments.Request({sender: _msgSender(), paid: data.price, params: params}));
}
}

0 comments on commit 8b96a43

Please sign in to comment.