Modifiers

A modifier is a way to indicate that the Command should be modified for a special case. This is similar to a decorator in programming languages, where a decorator is a function that modifies another function or method. This allows a MetaProtocol to divide actions into logical groups, such as perps, tokens or bridging. Without this, every metaprotocol would need to have a singular focus. A module on Simulacrum is similar to a module in a software project, where each applications has one or more modules.

For example, a metaprotocol might have two modifiers:

#metaprotocol #modifier1 #modifier2
0.01 ETH

These modifiers could be something like: #token #launch and this would tell the metaprotocol that the command args/kwargs are to be used to launch a token.

Likewise, you could provide the modifiers #nft #launch and the metaprotocol would be able to handle this differently.

Last updated