SymmioPartyB
The SymmioPartyB contract acts as a management contract for solvers . This contract allows for controlled interaction with the Symmio platform and external addresses for managing roles and permissions. It supports multicast calls to whitelisted external contracts, and implements EIP-1271 signature verification.
Initialization
function initialize(address admin, address symmioAddress_) public initializer;Sets up the upgradeable contract. Grants DEFAULT_ADMIN_ROLE, SETTER_ROLE, and MANAGER_ROLE to admin. Sets the Symmio diamond address.
The constructor is empty and calls _disableInitializers() to prevent direct initialization of the implementation contract.
Roles
DEFAULT_ADMIN_ROLE
Set Symmio address, configure restricted selectors
SETTER_ROLE
Set the authorized signer
MANAGER_ROLE
Call restricted selectors, manage multicast whitelist, withdraw tokens
TRUSTED_ROLE
Call non-restricted selectors on Symmio, call whitelisted external contracts, approve tokens
PAUSER_ROLE
Pause the contract
UNPAUSER_ROLE
Unpause the contract
Admin Functions
setSymmioAddress()
Updates the Symmio diamond address.
Event: SetSymmioAddress(oldAddress, newAddress)
setRestrictedSelector()
Marks a function selector as restricted. Restricted selectors can only be called by MANAGER_ROLE — even TRUSTED_ROLE is insufficient.
Event: SetRestrictedSelector(selector, state)
setSigner()
Sets the authorized signer address used for EIP-1271 signature verification.
setMulticastWhitelist()
Adds or removes an address from the multicast whitelist. Cannot whitelist the contract's own address.
Event: SetMulticastWhitelist(addr, state)
Token Management
_approve()
Approves the Symmio diamond to spend amount of token from this contract. Reverts with TokenNotApproved on failure.
withdrawERC20()
Transfers amount of token to the caller. Reverts with TokenNotTransferred on failure.
Call Execution
_call()
Executes one or more calls to the Symmio diamond. Each call's function selector is checked against restrictedSelectors to determine the required role.
Access control per call:
Restricted selector → requires
MANAGER_ROLENon-restricted selector → requires
MANAGER_ROLE,TRUSTED_ROLE, or the call must originate from the Instant Layer (isCallFromInstantLayer())
_multicastCall
Executes calls to multiple different target contracts. Arrays must be the same length. Each target is individually validated:
Symmio address → same selector-based access control as
_callOther addresses → must be on the multicast whitelist and caller must have
TRUSTED_ROLE
Reverts with DestinationNotWhitelisted if a non-Symmio target isn't whitelisted.
Internal Execution Logic
_executeCall handles all security checks for both _call and _multicastCall:
Reverts if destination is
address(0)or call data is less than 4 bytes.Extracts the function selector from the call data.
Checks permissions based on destination and selector (see access control rules above).
Executes the call. On failure, bubbles up the revert data.
Pause Control
Pauses/unpauses _call, _multicastCall, and _approve. View functions remain available.
EIP-1271 Signature Verification
Delegates to the SignatureVerifier base contract using the configured signer address. Returns 0x1626ba7e if valid, 0xffffffff otherwise.
Last updated
