Infernet
SDK
Reference
Patterns
Delegator

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

NameTypeDescription
signer_addressauthorized address

_updateSigner

Update delegated signer

No event is emitted given contract is meant to be inherited

function _updateSigner(address newSigner) internal;

Parameters

NameTypeDescription
newSigneraddressnew delegated signer address

getSigner

Get delegated signer

function getSigner() external view returns (address);

Returns

NameTypeDescription
<none>addressauthorized signer address