Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ekubo = { git = "https://github.com/EkuboProtocol/starknet-contracts.git", tag =
starknet.workspace = true
# Group packages
game_components_interfaces = { path = "packages/interfaces" }
interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", rev = "3c5a1ef" }
metagame_extensions_interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", tag = "v0.1.1" }
game_components_embeddable_game_standard = { path = "packages/embeddable_game_standard" }
game_components_metagame = { path = "packages/metagame" }
game_components_economy = { path = "packages/economy" }
Expand Down
2 changes: 1 addition & 1 deletion packages/interfaces/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ edition.workspace = true
[dependencies]
starknet.workspace = true
ekubo.workspace = true
interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", rev = "3c5a1ef" }
metagame_extensions_interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", tag = "v0.1.1" }

[lib]
2 changes: 1 addition & 1 deletion packages/interfaces/src/entry_fee.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use interfaces::extension::ExtensionConfig;
use metagame_extensions_interfaces::extension::ExtensionConfig;
use starknet::ContractAddress;

/// SNIP-5 interface ID derived via src5_rs: XOR of extended function selectors
Expand Down
2 changes: 1 addition & 1 deletion packages/interfaces/src/entry_requirement.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use interfaces::extension::ExtensionConfig;
pub use metagame_extensions_interfaces::extension::ExtensionConfig;
use starknet::ContractAddress;

/// SNIP-5 interface ID derived via src5_rs: XOR of extended function selectors
Expand Down
2 changes: 1 addition & 1 deletion packages/interfaces/src/prize.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use game_components_interfaces::distribution::Distribution;
use interfaces::extension::ExtensionConfig;
use metagame_extensions_interfaces::extension::ExtensionConfig;
use starknet::ContractAddress;

/// SNIP-5 interface ID derived via src5_rs: XOR of extended function selectors
Expand Down
2 changes: 1 addition & 1 deletion packages/metagame/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ openzeppelin_interfaces.workspace = true
openzeppelin_introspection.workspace = true
game_components_interfaces = { path = "../interfaces" }
game_components_utilities = { path = "../utilities" }
interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", rev = "3c5a1ef" }
metagame_extensions_interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", tag = "v0.1.1" }

[dev-dependencies]
snforge_std.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions packages/metagame/src/entry_fee/entry_fee_component.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
pub mod EntryFeeComponent {
use core::num::traits::Zero;
use game_components_interfaces::entry_fee::{IENTRY_FEE_ID, IEntryFee};
use interfaces::entry_fee_extension::{
use metagame_extensions_interfaces::entry_fee_extension::{
IENTRY_FEE_EXTENSION_ID, IEntryFeeExtensionDispatcher, IEntryFeeExtensionDispatcherTrait,
};
use interfaces::extension::ExtensionConfig;
use metagame_extensions_interfaces::extension::ExtensionConfig;
use openzeppelin_interfaces::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};
use openzeppelin_interfaces::introspection::{ISRC5Dispatcher, ISRC5DispatcherTrait};
use openzeppelin_introspection::src5::SRC5Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ fn test_set_entry_fee_extension_stores_address_and_config() {

let config_data = array![0x111, 0x222, 0x333];
let entry_fee = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr, config: config_data.span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr, config: config_data.span(),
},
);
mock.set_entry_fee(1, entry_fee);

Expand All @@ -547,7 +549,9 @@ fn test_set_entry_fee_extension_blocks_second_set() {
mock_extension_calls(ext_addr);

let entry_fee = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr, config: array![0x1].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr, config: array![0x1].span(),
},
);
mock.set_entry_fee(1, entry_fee);

Expand All @@ -556,7 +560,9 @@ fn test_set_entry_fee_extension_blocks_second_set() {
mock_extension_calls(ext_addr2);

let entry_fee2 = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr2, config: array![0x2].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr2, config: array![0x2].span(),
},
);
mock.set_entry_fee(1, entry_fee2);
}
Expand All @@ -569,7 +575,9 @@ fn test_set_entry_fee_extension_with_empty_config() {
mock_extension_calls(ext_addr);

let entry_fee = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr, config: array![].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr, config: array![].span(),
},
);
mock.set_entry_fee(1, entry_fee);

Expand All @@ -588,7 +596,9 @@ fn test_get_entry_fee_returns_none_for_extension_only() {
mock_extension_calls(ext_addr);

let entry_fee = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr, config: array![0x1].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr, config: array![0x1].span(),
},
);
mock.set_entry_fee(1, entry_fee);

Expand Down Expand Up @@ -689,13 +699,17 @@ fn test_extension_address_isolation_by_context() {
// Set extensions on two different contexts
mock_extension_calls(ext_addr1);
let entry_fee1 = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr1, config: array![].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr1, config: array![].span(),
},
);
mock.set_entry_fee(1, entry_fee1);

mock_extension_calls(ext_addr2);
let entry_fee2 = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr2, config: array![].span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr2, config: array![].span(),
},
);
mock.set_entry_fee(2, entry_fee2);

Expand Down Expand Up @@ -821,7 +835,9 @@ fn test_extension_address_and_config_together() {

let config_data = array![0x42, 0x84, 0xFF];
let entry_fee = EntryFee::Extension(
interfaces::extension::ExtensionConfig { address: ext_addr, config: config_data.span() },
metagame_extensions_interfaces::extension::ExtensionConfig {
address: ext_addr, config: config_data.span(),
},
);
mock.set_entry_fee(1, entry_fee);

Expand Down
4 changes: 2 additions & 2 deletions packages/metagame/src/entry_requirement/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Entry requirement component for gating access to contexts (tournaments, quests,
Supports three requirement types:
- **Token**: Requires ownership of a specific NFT
- **Allowlist**: Requires address to be in an allowlist
- **Extension**: Delegates validation to an external IEntryValidator contract
- **Extension**: Delegates validation to an external IEntryRequirementExtension contract

Also includes the EntryValidatorComponent base for building custom validator contracts.

## Dependencies
- `game_components_interfaces` - EntryRequirement types and IEntryValidator interface
- `game_components_interfaces` - EntryRequirement types and IEntryRequirementExtension interface
Comment on lines +8 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Document the new interface under the correct package.

Line 13 still says game_components_interfaces provides IEntryRequirementExtension, but the code in this PR moves that interface to metagame_extensions_interfaces. Please split this into the actual packages used now, otherwise contributors will add the wrong dependency.

Based on learnings "Applies to packages/metagame/src/entry_requirement/**/AGENTS.md : Document agent implementations and configurations in AGENTS.md".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/metagame/src/entry_requirement/AGENTS.md` around lines 8 - 13,
Update AGENTS.md to list the correct packages for the moved interface: state
that IEntryRequirementExtension is provided by metagame_extensions_interfaces
(not game_components_interfaces) and keep the EntryRequirement types /
EntryValidatorComponent references under game_components_interfaces; ensure both
packages are explicitly mentioned so contributors add the correct dependency for
IEntryRequirementExtension and for EntryRequirement
types/EntryValidatorComponent.

- `openzeppelin_interfaces` - ERC20/ERC721 interfaces
- `openzeppelin_introspection` - SRC5 interface registration
10 changes: 5 additions & 5 deletions packages/metagame/src/entry_requirement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Entry gating component for controlling access to contexts (tournaments, quests,
- Three requirement types: Token, Allowlist, and Extension
- Token ownership requirement for NFT gating
- Allowlist-based access control
- External validator extension via `IEntryValidator` for custom logic
- External validator extension via `IEntryRequirementExtension` for custom logic
- Built-in `EntryValidatorComponent` for building custom validators
- SRC5 interface registration

Expand All @@ -17,7 +17,7 @@ Entry gating component for controlling access to contexts (tournaments, quests,
|------|-------------|
| `Token` | Requires caller to own a specific NFT (ERC721 balance check) |
| `Allowlist` | Requires caller's address to be on an approved list |
| `Extension` | Delegates validation to an external `IEntryValidator` contract |
| `Extension` | Delegates validation to an external `IEntryRequirementExtension` contract |

## Interface

Expand All @@ -28,12 +28,12 @@ Entry gating component for controlling access to contexts (tournaments, quests,
| `get_entry_requirement(context_id)` | Get the requirement config for a context |
| `meets_entry_requirement(context_id, player)` | Check if player meets the requirement |

### IEntryValidator (Extension Interface)
### IEntryRequirementExtension (Extension Interface)

Custom validator contracts implement this:

```cairo
trait IEntryValidator<TState> {
trait IEntryRequirementExtension<TState> {
fn validate_entry(self: @TState, context_id: u64, player: ContractAddress) -> bool;
}
Comment on lines +31 to 38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

In Provable-Games/metagame_extensions tag v0.1.1, what package exports the Cairo trait IEntryRequirementExtension, and what methods does that trait define?

💡 Result:

In tag v0.1.1, the Cairo trait IEntryRequirementExtension is exported by the Scarb package metagame_extensions_interfaces. [1]

IEntryRequirementExtension<TState> defines these methods: [2]

  • fn owner_address(self: @tstate) -> ContractAddress;
  • fn registration_only(self: @tstate) -> bool;
  • fn valid_entry(self: @tstate, context_id: u64, player_address: ContractAddress, qualification: Span<felt252>) -> bool;
  • fn should_ban(self: @tstate, context_id: u64, game_token_id: felt252, current_owner: ContractAddress, qualification: Span<felt252>) -> bool;
  • fn entries_left(self: @tstate, context_id: u64, player_address: ContractAddress, qualification: Span<felt252>) -> Option<u8>;
  • fn add_config(ref self: TState, context_id: u64, entry_limit: u8, config: Span<felt252>);
  • fn add_entry(ref self: TState, context_id: u64, game_token_id: felt252, player_address: ContractAddress, qualification: Span<felt252>);
  • fn remove_entry(ref self: TState, context_id: u64, game_token_id: felt252, player_address: ContractAddress, qualification: Span<felt252>);

Sources: [1] (github.com) [2] (github.com)

Citations:


Update the extension interface documentation to match metagame_extensions_interfaces v0.1.1.

The README documents validate_entry as the only method and attributes the interface to game_components_interfaces. The actual IEntryRequirementExtension trait in metagame_extensions_interfaces exports 8 methods: owner_address, registration_only, valid_entry, should_ban, entries_left, add_config, add_entry, and remove_entry. Replace the code snippet and package reference to show the correct interface shape and source.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/metagame/src/entry_requirement/README.md` around lines 31 - 38,
Update the README snippet to reflect the IEntryRequirementExtension trait as
exported by metagame_extensions_interfaces v0.1.1: replace the single-method
example with the full trait signature listing the eight methods (owner_address,
registration_only, valid_entry, should_ban, entries_left, add_config, add_entry,
remove_entry) and change the package reference from game_components_interfaces
to metagame_extensions_interfaces; ensure the example uses the exact trait name
IEntryRequirementExtension and includes the method names and expected signatures
to match the v0.1.1 interface.

```
Expand Down Expand Up @@ -81,6 +81,6 @@ let allowed = self.entry_req.meets_entry_requirement(context_id, player);

## Dependencies

- `game_components_interfaces` - EntryRequirement types and IEntryValidator interface
- `game_components_interfaces` - EntryRequirement types and IEntryRequirementExtension interface
- `openzeppelin_interfaces` - ERC20/ERC721 interfaces
- `openzeppelin_introspection` - SRC5 interface registration
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
pub mod EntryRequirementComponent {
use core::num::traits::Zero;
use game_components_interfaces::entry_requirement::{IENTRY_REQUIREMENT_ID, IEntryRequirement};
use interfaces::entry_requirement_extension::IENTRY_REQUIREMENT_EXTENSION_ID;
use metagame_extensions_interfaces::entry_requirement_extension::IENTRY_REQUIREMENT_EXTENSION_ID;
use openzeppelin_interfaces::erc721::IERC721_ID;
use openzeppelin_interfaces::introspection::{ISRC5Dispatcher, ISRC5DispatcherTrait};
use openzeppelin_introspection::src5::SRC5Component;
Expand Down Expand Up @@ -228,7 +228,7 @@ pub mod EntryRequirementComponent {
let display_address: felt252 = config.address.into();
assert!(
src5.supports_interface(IENTRY_REQUIREMENT_EXTENSION_ID),
"EntryRequirement: Extension {} does not support IEntryValidator",
"EntryRequirement: Extension {} does not support IEntryRequirementExtension",
display_address,
);
self.set_extension_address(context_id, config.address);
Expand Down Expand Up @@ -285,7 +285,7 @@ pub mod EntryRequirementComponent {
}

/// Validates entry requirement configuration at creation time.
/// Checks SRC5 interfaces (ERC721 for token, IEntryValidator for extension).
/// Checks SRC5 interfaces (ERC721 for token, IEntryRequirementExtension for extension).
fn assert_valid_entry_requirement(
self: @ComponentState<TContractState>, entry_requirement: EntryRequirement,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1

use core::num::traits::Zero;
use interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryValidatorDispatcher, IEntryValidatorDispatcherTrait,
use metagame_extensions_interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryRequirementExtensionDispatcher,
IEntryRequirementExtensionDispatcherTrait,
};
use openzeppelin_interfaces::erc721::{IERC721Dispatcher, IERC721DispatcherTrait, IERC721_ID};
use openzeppelin_interfaces::introspection::{ISRC5Dispatcher, ISRC5DispatcherTrait};
Expand Down Expand Up @@ -158,14 +159,13 @@ pub impl EntryRequirementStoreImpl<T, +Store<T>, +Drop<T>> of EntryRequirementSt
"EntryRequirement: Provided qualification proof is not of type 'Extension'",
),
};
let entry_validator_dispatcher = IEntryValidatorDispatcher {
let extension_dispatcher = IEntryRequirementExtensionDispatcher {
contract_address: extension_config.address,
};
let caller_address = get_caller_address();
let display_extension_address: felt252 = extension_config.address.into();
assert!(
entry_validator_dispatcher
.valid_entry(context_id, caller_address, qualification),
extension_dispatcher.valid_entry(context_id, caller_address, qualification),
"EntryRequirement: Invalid entry according to extension {}",
display_extension_address,
);
Expand Down Expand Up @@ -196,7 +196,7 @@ pub impl EntryRequirementStoreImpl<T, +Store<T>, +Drop<T>> of EntryRequirementSt
let display_address: felt252 = extension_address.into();
assert!(
src5_dispatcher.supports_interface(IENTRY_REQUIREMENT_EXTENSION_ID),
"EntryRequirement: Extension address {} does not support IEntryValidator interface",
"EntryRequirement: Extension address {} does not support IEntryRequirementExtension interface",
display_address,
);
},
Expand All @@ -212,7 +212,7 @@ pub impl EntryRequirementStoreImpl<T, +Store<T>, +Drop<T>> of EntryRequirementSt
match entry_requirement.entry_requirement_type {
EntryRequirementType::extension(extension_config) => {
let extension_address = extension_config.address;
let entry_validator_dispatcher = IEntryValidatorDispatcher {
let extension_dispatcher = IEntryRequirementExtensionDispatcher {
contract_address: extension_address,
};
let display_extension_address: felt252 = extension_address.into();
Expand All @@ -225,7 +225,7 @@ pub impl EntryRequirementStoreImpl<T, +Store<T>, +Drop<T>> of EntryRequirementSt
),
};

let entries_left = entry_validator_dispatcher
let entries_left = extension_dispatcher
.entries_left(context_id, caller_address, qualification);
Comment on lines +228 to 229

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

In update_qualification_entries, when the entry requirement type is an extension, the code calls extension_dispatcher.entries_left to check if the user has remaining entries. However, after a successful entry, it fails to call extension_dispatcher.add_entry to notify the extension that an entry has occurred. Since the extension is not notified, its internal state (e.g., the number of entries used by a player) is never updated. This results in entries_left always returning the same value, effectively bypassing any entry limits enforced by the extension.

After successfully validating that entries_left > 0 (or if it's Option::None), the code should call extension_dispatcher.add_entry to record the entry in the extension contract.


match entries_left {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// Mock that implements IEntryValidator with limited entries remaining.
/// Mock that implements IEntryRequirementExtension with limited entries remaining.
/// Always accepts entries (valid_entry returns true), entries_left returns Option::Some(5).
#[starknet::contract]
pub mod AcceptingLimitedEntryValidatorMock {
use interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID, IEntryValidator};
use metagame_extensions_interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryRequirementExtension,
};
use openzeppelin_introspection::src5::SRC5Component;
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use starknet::ContractAddress;
Expand Down Expand Up @@ -36,7 +38,7 @@ pub mod AcceptingLimitedEntryValidatorMock {
}

#[abi(embed_v0)]
impl EntryValidatorImpl of IEntryValidator<ContractState> {
impl EntryValidatorImpl of IEntryRequirementExtension<ContractState> {
fn owner_address(self: @ContractState) -> ContractAddress {
self.owner_address.read()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// Simple mock that implements IEntryValidator without using the component.
/// Simple mock that implements IEntryRequirementExtension without using the component.
/// Always accepts entries (valid_entry returns true, should_ban returns false).
#[starknet::contract]
pub mod EntryValidatorMock {
use interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID, IEntryValidator};
use metagame_extensions_interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryRequirementExtension,
};
use openzeppelin_introspection::src5::SRC5Component;
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use starknet::ContractAddress;
Expand Down Expand Up @@ -36,7 +38,7 @@ pub mod EntryValidatorMock {
}

#[abi(embed_v0)]
impl EntryValidatorImpl of IEntryValidator<ContractState> {
impl EntryValidatorImpl of IEntryRequirementExtension<ContractState> {
fn owner_address(self: @ContractState) -> ContractAddress {
self.owner_address.read()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/// Simple mock that implements IEntryValidator but always rejects entries.
/// Simple mock that implements IEntryRequirementExtension but always rejects entries.
#[starknet::contract]
pub mod RejectingEntryValidatorMock {
use interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID, IEntryValidator};
use metagame_extensions_interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryRequirementExtension,
};
use openzeppelin_introspection::src5::SRC5Component;
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use starknet::ContractAddress;
Expand Down Expand Up @@ -35,7 +37,7 @@ pub mod RejectingEntryValidatorMock {
}

#[abi(embed_v0)]
impl EntryValidatorImpl of IEntryValidator<ContractState> {
impl EntryValidatorImpl of IEntryRequirementExtension<ContractState> {
fn owner_address(self: @ContractState) -> ContractAddress {
self.owner_address.read()
}
Expand Down
4 changes: 2 additions & 2 deletions packages/metagame/src/prize/prize_component.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
pub mod PrizeComponent {
use core::num::traits::Zero;
use game_components_interfaces::prize::{IPRIZE_ID, IPrize};
use interfaces::extension::ExtensionConfig;
use interfaces::prize_extension::{
use metagame_extensions_interfaces::extension::ExtensionConfig;
use metagame_extensions_interfaces::prize_extension::{
IPRIZE_EXTENSION_ID, IPrizeExtensionDispatcher, IPrizeExtensionDispatcherTrait,
};
use openzeppelin_interfaces::erc20::{IERC20Dispatcher, IERC20DispatcherTrait};
Expand Down
2 changes: 1 addition & 1 deletion packages/test_common/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ game_components_interfaces = { path = "../interfaces" }
game_components_embeddable_game_standard = { path = "../embeddable_game_standard" }
game_components_metagame = { path = "../metagame" }
game_components_utilities = { path = "../utilities" }
interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", rev = "3c5a1ef" }
metagame_extensions_interfaces = { git = "https://github.com/Provable-Games/metagame_extensions.git", tag = "v0.1.1" }

[lib]

Expand Down
8 changes: 5 additions & 3 deletions packages/test_common/src/mocks/mock_entry_validator.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// Simple mock that implements IEntryValidator without using the component.
/// Simple mock that implements IEntryRequirementExtension without using the component.
/// Always accepts entries (valid_entry returns true, should_ban returns false).
#[starknet::contract]
pub mod EntryValidatorMock {
use interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID, IEntryValidator};
use metagame_extensions_interfaces::entry_requirement_extension::{
IENTRY_REQUIREMENT_EXTENSION_ID, IEntryRequirementExtension,
};
use openzeppelin_introspection::src5::SRC5Component;
use openzeppelin_introspection::src5::SRC5Component::InternalTrait as SRC5InternalTrait;
use starknet::ContractAddress;
Expand Down Expand Up @@ -36,7 +38,7 @@ pub mod EntryValidatorMock {
}

#[abi(embed_v0)]
impl EntryValidatorImpl of IEntryValidator<ContractState> {
impl EntryValidatorImpl of IEntryRequirementExtension<ContractState> {
fn owner_address(self: @ContractState) -> ContractAddress {
self.owner_address.read()
}
Expand Down
Loading