OAppAuthCore
Inherits: IOAppCore, Auth
Abstract contract implementing the IOAppCore interface with basic OApp configurations.
This Auth version of OAppCore uses solmate's Auth instead of OZ's Ownable for compatibility purposes
State Variables
endpoint
peers
Functions
constructor
Constructor to initialize the OAppCore with the provided endpoint and delegate.
The delegate typically should be set as the owner of the contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the LOCAL Layer Zero endpoint. |
|
| The delegate capable of making OApp configurations inside of the endpoint. |
setPeer
Sets the peer address (OApp instance) for a corresponding endpoint.
this contract replaces the OZ Ownable onlyOwner with Solmate requiresAuth
Only the owner/admin of the OApp can call this function.
Indicates that the peer is trusted to send LayerZero messages to this OApp.
Set this to bytes32(0) to remove the peer address.
Peer is a bytes32 to accommodate non-evm chains.
Parameters
Name | Type | Description |
---|---|---|
|
| The endpoint ID. |
|
| The address of the peer to be associated with the corresponding endpoint. |
_setPeer
Sets the peer address (OApp instance) for a corresponding endpoint.
Indicates that the peer is trusted to send LayerZero messages to this OApp.
Set this to bytes32(0) to remove the peer address.
Peer is a bytes32 to accommodate non-evm chains.
Parameters
Name | Type | Description |
---|---|---|
|
| The endpoint ID. |
|
| The address of the peer to be associated with the corresponding endpoint. |
_getPeerOrRevert
Internal function to get the peer address associated with a specific endpoint; reverts if NOT set. ie. the peer is set to bytes32(0).
Parameters
Name | Type | Description |
---|---|---|
|
| The endpoint ID. |
Returns
Name | Type | Description |
---|---|---|
|
| peer The address of the peer associated with the specified endpoint. |
setDelegate
Sets the delegate address for the OApp.
this contract replaces the OZ Ownable onlyOwner with Solmate requiresAuth
Only the owner/admin of the OApp can call this function.
Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the delegate to be set. |