Intro

Blueprints is an ecosystem of classes of tokens, each of the instances expressing a position. Examples of tokens include:

Although positions expressed by these tokens are vastly different, all of them share a common interface.

As seen in the latter example, the tokens are composable – one position can be an argument of another. This allows infinitely intricate positions to be created from simple primitives.

Benefits of using Blueprints

Blueprints

NativeToken, ERC20Wrapper, ComposablePrediction are examples of Blueprints. Each of them is implemented in a separate smart contract. Anyone can create and deploy their own Blueprint.

Each smart contract manages their own token space. Tokens minted by a Blueprint have a 256-bit internal token id. The external token id is calculated by hashing the smart contract's address and the internal token id. This assures that, for example, the NativeToken Blueprint cannot mint ERC20Wrapper tokens.

Blueprint Manager

Blueprint Manager is a smart contract which keeps track of balances. Each address is split into 22562^{256} subaccounts which is oftentimes helpful. Blueprint Manager also implements flash accounting – the ability to spend tokens one will receive later in the same transaction.

Oracles

An oracle feed is defined by the oracle address and a 256-bit feed id. The interpretation of the feed id is left to the operator of the oracle. A feed resolves to a 256-bit unsigned integer.

Oracles shouldn't return different readings for the same feed id, but technically there's nothing preventing them from doing so. If consistent readings are desired, you can wrap an oracle in a ConstantOracle.

On this page
Benefits of using BlueprintsBlueprintsBlueprint ManagerOracles