Skip to content

brainy-bots/efguard-gate-example

Repository files navigation

ef_guard Gate Example

This is the standard EVE Frontier builder-scaffold with one key change: the smart gate's access control is powered by ef_guard instead of an inline tribe check.

What changed

The second commit shows all changes. Summary:

Before (scaffold default)

// tribe_permit.move — checks one hardcoded tribe
assert!(character.tribe() == tribe_cfg.tribe, ENotStarterTribe);

After (with ef_guard)

// tribe_permit.move — delegates to ef_guard rule engine
let (char_game_id, tribe_id) = identity_resolver::resolve(character);
let decision = assembly_binding::resolve_role(binding, gate_id, char_game_id, tribe_id);
assert!(assembly_binding::is_allow(&decision), EAccessDenied);

What this enables

Feature Scaffold (before) ef_guard (after)
Tribe access Single tribe only Multiple tribes with priority
Character access Not supported Allow/deny individual players
Blocklist Not supported Permanent deny list
Rule updates Redeploy contract Update on-chain, no redeploy
Rule priority N/A First-match-wins, configurable order
Default policy Allow all or deny all Configurable (deny if no match)

Files changed

File Change
move-contracts/smart_gate_extension/Move.toml Added ef_guard dependency
move-contracts/smart_gate_extension/sources/tribe_permit.move Replaced inline tribe check with assembly_binding::resolve_role()
ts-scripts/smart_gate_extension/configure-rules.ts Creates ef_guard binding + rules instead of setting tribe config

Files NOT changed

  • config.move — unchanged (still provides XAuth witness and ExtensionConfig)
  • corpse_gate_bounty.move — unchanged (bounty logic is independent of access control)
  • All other scaffold files — unchanged

How to use

Follow the standard builder-scaffold flow. The only addition is setting EFGUARD_PACKAGE_ID in your .env after deploying ef_guard.

License

MIT

About

Smart Gate example using ef_guard for access control — shows how to replace inline tribe checks with ef_guard middleware

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors