Architecture
Learn how the transmissions protocol works
Terminology
- Channel: A modified ERC-1155 collection. The foundational entity of the protocol.
- Transport Layer: Application specific contracts sitting on top of channels.
- Interaction Logic: Custom logic which governs who is allowed to create and mint tokens in a channel.
Channel Factory
Channels are created by calling the channel factory contract. The factory creates a new ERC1967Proxy to one of the channel type implementations (Infinite or Finite). Anyone can create a channel by interacting with the factory.
Channels
Channel.sol calls to 2 external contracts to manage mint fees and interaction logic. Any fee or logic contract can be passed to the channel. The initial protocol release comes with:
CustomFees.sol - Custom incentive structure which allows admins / managers to define how mint fees (if any) are distributed to different parties. Mint fees can be set in ETH or ERC20.
DynamicLogic.sol - Logic which governs the interaction power (num creations / num mints) allotted to users in a channel based on results of external calls to other contracts at runtime.
Channel fees
Mint fees and protocol reward splits are set at the channel level for all tokens. By default, the channel has no fees.
Fees are set by calling the setFees function on the channel either during initialization in setupActions[]
or after the channel is created.
Fees can be disabled by setting the fee contract to address 0.
Channel logic
Interaction logic is set at the channel level for all tokens. By default, the channel has no logic, meaning everyone can create and mint an unlimited number of tokens.
The interaction logic is set by calling the setLogic function on the channel either during initialization in setupActions[]
or after the channel is created.
All logic can be disabled by setting the logic contract to address 0. Logic for each actor (creator / minter) can be set independently by passing 0 bytes respectively.
Rewards
Protocol rewards and escrowed finite channel rewards are managed by Rewards.sol. Each channel has its own instance of Rewards.sol which is created during channel initialization.
Protocol rewards are pushed to recipients on every mint.
Escrowed rewards are distributed after finite channels are settled.
Access control
Channels have 1 admin and 0 or more managers. Admins can add and remove managers, but otherwise have the same authority as managers. Both roles can:
- update the channel fees, logic, and metadata
- cancel finite channels
- authorize channel upgrades
Admins can remove all managers and transfer ownership to address zero to lock the channel settings forever.
Admins and managers are assumed to be trusted parties which define the rules of engagement for the channel. Users visit the channel and either create or mint tokens.
Upgrades
Over time, we expect the protocol to evolve. When we upgrade the protocol, we register the new implementation address in the global UpgradePath.sol contract. This gives admins / managers a choice to either
upgrade their channel to the new implementation, or keep using the old version. The SDK provides a method getOptimalUpgradePath
that operators can use to determine if upgrades are available.
Transport Layers
The transport layer is the home of application specific functionality that site on top of channels. The transport layer receives messages from the channel on each creation or mint event and does some amount of extra processing.
We currently support 2 transport layers: Infinite and Finite.
Infinite Channels
Infinite Channels are very simple. They accept new tokens forever, and mints of them for a fixed period. The job of the infinite transport layer is to make sure the sale duration is respected.
Finite Channels
Finite Channels accept new tokens, and mints of those tokens, for a fixed period. Finite channels are meant to operate as a contest, in which rewards are escrowed by the admins on initialization and distributed after the contest ends by calling a settle function. The transport layer for finite channels is responsible for managing the contest state and maintaining the correct ranks, ordered by mints, of tokens in the channel. It does this by managing a doubly linked list.