PartyA
The SymmioPartyA contract serves as a proxy for users to interact with the Symmio platform via their respective sub-accounts. Each sub-account, represented by an instance of SymmioPartyA, can forward calls to the Symmio diamond. Here's a detailed breakdown of the functionalities and features provided by this contract:
Constructor
Initializes a new SymmioPartyA contract with specific roles and addresses.
constructor(address admin, address multiAccountAddress, address symmioAddress_) {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(MULTIACCOUNT_ROLE, multiAccountAddress);
symmioAddress = symmioAddress_;
}Parameters:
admin: The administrator of the contract who is granted theDEFAULT_ADMIN_ROLE.multiAccountAddress: The address of theMultiAccountcontract, granted theMULTIACCOUNT_ROLEto allow it to make calls on behalf of the sub-account.symmioAddress_: The initial address of the Symmio platform contract to which all calls will be forwarded.
Operations:
Grants
DEFAULT_ADMIN_ROLEtoadmin.Grants
MULTIACCOUNT_ROLEtomultiAccountAddress.Sets the initial Symmio platform address (this is the Diamond).
setSymmioAddress()
Updates the address of the Symmio platform contract. Only an account with DEFAULT_ADMIN_ROLE can invoke this function.
function setSymmioAddress(address symmioAddress_) external onlyRole(DEFAULT_ADMIN_ROLE) {
emit SetSymmioAddress(symmioAddress, symmioAddress_);
symmioAddress = symmioAddress_;
}Parameters:
symmioAddress_: The new address of the Symmio platform.
Operations:
Emits a
SetSymmioAddressevent containing the old and new addresses.Updates the
symmioAddressstate variable.
Events:
event SetSymmioAddress(address oldV3ContractAddress, address newV3ContractAddress);_call()
Forwards calls from the SymmioPartyA contract to the Symmio platform. This method is crucial for interacting with the Symmio functionalities through sub-accounts. Only an account with MULTIACCOUNT_ROLE can invoke this function, meaning only the MultiAccount contract can direct actions.
function _call(bytes memory _callData) external onlyRole(MULTIACCOUNT_ROLE) returns (bool _success, bytes memory _resultData) {
return symmioAddress.call{ value: 0 }(_callData);
}Parameters:
_callData: The bytecode of the function call to be forwarded to the Symmio platform.
Returns:
_success: A boolean indicating whether the call was successful._resultData: The data returned from the call if successful, or error information if the call failed.
Last updated