From 618d4ebba6cba644382faa6f2212338465b57621 Mon Sep 17 00:00:00 2001 From: James Duncombe Date: Tue, 5 Mar 2024 13:52:46 +0000 Subject: [PATCH] Updates Fast init facet for forwardable data. --- contracts/fast/FastAccessFacet.sol | 14 +++++++++++++- contracts/fast/FastInitFacet.sol | 8 ++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/contracts/fast/FastAccessFacet.sol b/contracts/fast/FastAccessFacet.sol index 6efc9cd1..443ebed5 100644 --- a/contracts/fast/FastAccessFacet.sol +++ b/contracts/fast/FastAccessFacet.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.10; import "../lib/LibAddressSet.sol"; import "../lib/LibPaginate.sol"; +import "../common/AHasContext.sol"; import "../common/AHasMembers.sol"; import "../common/AHasGovernors.sol"; import "../marketplace/MarketplaceAccessFacet.sol"; @@ -19,7 +20,7 @@ import "./FastAutomatonsFacet.sol"; * @notice The FAST Access facet is the source of truth when it comes to * permissioning and ACLs within a given FAST. */ -contract FastAccessFacet is AFastFacet, AHasGovernors, AHasMembers { +contract FastAccessFacet is AFastFacet, AHasGovernors, AHasMembers, AHasContext { using LibAddressSet for LibAddressSet.Data; /// Structs. @@ -35,6 +36,17 @@ contract FastAccessFacet is AFastFacet, AHasGovernors, AHasMembers { bool isMember; } + /// AHasContext implementation. + + function _isTrustedForwarder(address forwarder) internal view override(AHasContext) returns (bool) { + return AHasForwarder(address(this)).isTrustedForwarder(forwarder); + } + + // Override base classes to use the AHasContext implementation. + function _msgSender() internal view override(AHasMembers, AHasGovernors, AHasContext) returns (address) { + return AHasContext._msgSender(); + } + /// AHasGovernors implementation. function isGovernorsManager(address who) internal view override(AHasGovernors) returns (bool) { diff --git a/contracts/fast/FastInitFacet.sol b/contracts/fast/FastInitFacet.sol index f607ae8f..7768a34f 100644 --- a/contracts/fast/FastInitFacet.sol +++ b/contracts/fast/FastInitFacet.sol @@ -4,6 +4,7 @@ pragma solidity 0.8.10; import "../common/lib/LibHasGovernors.sol"; import "../common/lib/LibHasMembers.sol"; import "../common/lib/LibHasAutomatons.sol"; +import "../common/lib/LibHasForwarder.sol"; import "../common/AHasGovernors.sol"; import "../common/AHasMembers.sol"; import "../common/AHasAutomatons.sol"; @@ -113,5 +114,12 @@ contract FastInitFacet is AFastFacet { // Initialize automatons storage. LibHasAutomatons.data().version = LibHasAutomatons.STORAGE_VERSION; + + // ------------------------------------- // + + // Initialize forwarder storage. + LibHasForwarder.Data storage forwarderData = LibHasForwarder.data(); + forwarderData.version = LibHasForwarder.STORAGE_VERSION; + forwarderData.forwarderAddress = address(0); } }