OperatorRegistry contract
Here is the translation of the provided information:
Operator - an account that can perform entry and exit operations in DEFII on behalf of a user. To allow an operator to handle deposits, the user must grant permission for the operator to manage their funds. The OperatorRegistry smart contract stores all user approvals. This contract is also used to check access by contracts in the SHIFT ecosystem.
OperatorRegistry uses EIP-2612 to ensure that a user's permissions are granted on a single network, meaning the user does not need to approve the operator on different networks.
Access can be granted to a specific smart contract or to all contracts in the ecosystem.
Read functions
ALL
Constant indicating that the user has granted the operator access to all smart contracts in the ecosystem.
address public constant ALL = address(0xa11);
APPROVE_OPERATOR_SELECTOR
Selector for the function that grants access to the operator.
bytes32 constant APPROVE_OPERATOR_SELECTOR;
DOMAIN_SEPARATOR
Domain separator for permits. For additional information, see EIP-2612.
bytes32 immutable DOMAIN_SEPARATOR_COMMON;
DOMAIN_SEPARATOR_CHAIN_SPECIFIC
Domain separator for approvals on actions on a specific chain.
bytes32 immutable DOMAIN_SEPARATOR_CHAIN_SPECIFIC;
nonce
Mapping with nonces. Nonces are provided for replay protection.
mapping(address => uint256) public nonce;
Write functions
approveOperator
Grants the operator access to perform actions on behalf of the user on a specific contract or on all contracts in the SHIFT ecosystem.
function approveOperator(address operator, address forAddress) external;
operator
address
Operator address
forAddress
address
Address of the contract for which access is granted
approveOperatorWithPermit
Similar to approveOperator but using permit.
function approveOperatorWithPermit(
address user,
address operator,
address forAddress,
uint256 chainId,
uint8 v,
bytes32 r,
bytes32 s
) external;
user
address
User granting access
operator
address
Operator's address
forAddress
address
Address of the contract for which access is granted
chainId
uint256
Network ID of the contract
v
uint8
Permit V parameter
r
bytes32
Permit R parameter
s
bytes32
Permit S parameter
removeOperator
Revokes access from the operator.
function removeOperator(address operator, address forAddress) external;
operator
address
Operator from whom msg.sender is revoking access
forAddress
address
Address of the smart contract for which access is restricted
isOperatorApprovedForAddress
Checks if the operator has access to a specific smart contract.
Last updated