Delegator
Git Source (opens in a new tab)
Exposes a signer
address (via getSigner()
) that allows an authorized EOA to sign off on actions on behalf of a contract
Allows developers to create Coordinator subscriptions off-chain, on behalf of a contract, by signing a
DelegateSubscription
from signer
and submitting to EIP712Coordinator.createSubscriptionDelegatee()
In theory, this could use EIP-1271 standard signature validation but that enables a contract owner to override what is a valid signature, which is more of a shotgun than just imposing a signer be specified
State Variables
signer
Authorized address with signing privileges
Recommended to use an EOA so that it can sign EIP-712 messages
Visibility is private
to prevent downstream direct modification outside of via _updateSigner()
address private signer;
Functions
constructor
Initialize new Delegator
constructor(address signer_);
Parameters
Name | Type | Description |
---|---|---|
signer_ | address | authorized address |
_updateSigner
Update delegated signer
No event is emitted given contract is meant to be inherited
function _updateSigner(address newSigner) internal;
Parameters
Name | Type | Description |
---|---|---|
newSigner | address | new delegated signer address |
getSigner
Get delegated signer
function getSigner() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | authorized signer address |