PayloadBroadcaster
Inherits: IPayloadBroadcaster, Migratable, Initializable
A payload broadcaster is a contract that broadcasts payloads as events, where payloads have a min and max size, both of which can be updated from a parameter registry.
State Variables
parameterRegistry
The address of the parameter registry.
address public immutable parameterRegistry;
_PAYLOAD_BROADCASTER_STORAGE_LOCATION
bytes32 internal constant _PAYLOAD_BROADCASTER_STORAGE_LOCATION =
0xeda186f2b85b2c197e0a3ff15dc0c5c16c74d00b5c7f432acaa215db84203b00;
Functions
_getPayloadBroadcasterStorage
function _getPayloadBroadcasterStorage() internal pure returns (PayloadBroadcasterStorage storage $);
constructor
Constructor for the implementation contract, such that the implementation cannot be initialized.
The parameter registry must not be the zero address.
The parameter registry is immutable so that it is inlined in the contract code, and has minimal gas cost.
constructor(address parameterRegistry_);
Parameters
| Name | Type | Description |
|---|---|---|
parameterRegistry_ | address | The address of the parameter registry. |
initialize
Initializes the contract.
function initialize() public virtual initializer;
updateMinPayloadSize
Updates the minimum payload size.
Ensures the new minimum is less than the maximum.
function updateMinPayloadSize() external;
updateMaxPayloadSize
Updates the maximum payload size.
Ensures the new maximum is greater than the minimum.
function updateMaxPayloadSize() external;
updatePauseStatus
Updates the pause status.
Ensures the new pause status is not equal to the old pause status.
function updatePauseStatus() external;
updatePayloadBootstrapper
Updates the payload bootstrapper.
Ensures the new payload bootstrapper is not equal to the old payload bootstrapper.
function updatePayloadBootstrapper() external;
migrate
Initiates a migration of the proxy, in a way defined by the implementation.
Normally, the implementation has a way of determining the migrator that needs to be delegatecalled.
function migrate() external;
minPayloadSizeParameterKey
The parameter registry key used to fetch the minimum payload size.
function minPayloadSizeParameterKey() public pure virtual returns (string memory key_);
maxPayloadSizeParameterKey
The parameter registry key used to fetch the maximum payload size.
function maxPayloadSizeParameterKey() public pure virtual returns (string memory key_);
migratorParameterKey
The parameter registry key used to fetch the migrator.
function migratorParameterKey() public pure virtual returns (string memory key_);
pausedParameterKey
The parameter registry key used to fetch the paused status.
function pausedParameterKey() public pure virtual returns (string memory key_);
payloadBootstrapperParameterKey
The parameter registry key used to fetch the payload bootstrapper.
function payloadBootstrapperParameterKey() public pure virtual returns (string memory key_);
minPayloadSize
Minimum valid payload size (in bytes).
function minPayloadSize() external view returns (uint32 size_);
maxPayloadSize
Maximum valid payload size (in bytes).
function maxPayloadSize() external view returns (uint32 size_);
paused
The pause status.
function paused() external view returns (bool paused_);
payloadBootstrapper
The payload bootstrapper.
function payloadBootstrapper() external view returns (address payloadBootstrapper_);
_isZero
function _isZero(address input_) internal pure returns (bool isZero_);
_revertIfPaused
function _revertIfPaused() internal view;
_revertIfNotPaused
function _revertIfNotPaused() internal view;
_revertIfInvalidPayloadSize
function _revertIfInvalidPayloadSize(uint256 payloadSize_) internal view;
_revertIfNotPayloadBootstrapper
function _revertIfNotPayloadBootstrapper() internal view;
Structs
PayloadBroadcasterStorage
The UUPS storage for the payload broadcaster.
Note: storage-location: erc7201:xmtp.storage.PayloadBroadcaster
struct PayloadBroadcasterStorage {
uint32 minPayloadSize;
uint32 maxPayloadSize;
uint64 sequenceId;
bool paused;
address payloadBootstrapper;
}
Properties
| Name | Type | Description |
|---|---|---|
minPayloadSize | uint32 | The minimum payload size. |
maxPayloadSize | uint32 | The maximum payload size. |
sequenceId | uint64 | A sequence ID for uniquely ordering payloads (should be monotonically increasing). |
paused | bool | The paused status. |
payloadBootstrapper | address |