The Proxy
Control access to an ancient, sleeping serpent with a vigilant gateway.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Abjuration // Warding Gateways
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# pragma version ^0.3.7
interface IAncientSerpent:
def consume_sacrifice(amount: uint256): nonpayable
ancient_serpent: public(address)
high_priest: public(address)
is_awake: public(bool)
@external
def __init__(_serpent: address, _priest: address):
self.ancient_serpent = _serpent
self.high_priest = _priest
self.is_awake = False
@external
def awaken():
assert msg.sender == self.high_priest, "Only the High Priest may wake it"
self.is_awake = True
@external
def offer_tribute(amount: uint256):
assert self.is_awake, "The Serpent slumbers still"
# The proxy forwards the validated request
IAncientSerpent(self.ancient_serpent).consume_sacrifice(amount)
The Proxy serves as a guardian interface. Directly interacting with the unbridled logic of the Ancient Serpent is forbidden and dangerous. The Proxy acts as a protective sigil, verifying the caller’s rank (High Priest), ensuring the astral conditions are correct (the Serpent is awake), and only then passing the tribute down to the hidden contract.
Runic Tags:
#structural
#proxy
#vyper
#access-control