Skip to main content

MasterContractManager

The MasterContractManager contract is in charge of approving or revoking a masterContract access to user funds.

The full contract can be found here.

Functions

_calculateDomainSeparator

function _calculateDomainSeparator(uint256 chainId) private view returns (bytes32)

Parameters

NameTypeDescription
chainIduint256ID of chain to calculate domain separator from

Private function called by DOMAIN_SEPARATOR that calculates and returns the domain separator based on the given chainId.

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() public view returns (bytes32)

Function that calls _calculateDomainSeparator, which returns the domain separator.

registerProtocol

function registerProtocol() public

Function used by other contracts to register with this master contract, so that user can approve them for BentoBox.

whitelistMasterContract

function whitelistMasterContract(address masterContract, bool approved) public onlyOwner

Function that enables or disables a contract for approval without signed message.

Parameters

NameTypeDescription
masterContractaddressaddress of the master contract to enable/disable approval for
approvedbooleanboolean set to true if function call is successful, false revokes access

setMasterContractApproval

function setMasterContractApproval(
address user,
address masterContract,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) public

Function that approves or revokes a masterContract access to user funds.

Parameters

NameTypeDescription
useraddressaddress of user that approves or revokes access
masterContractaddressaddress of master contract to enable/disable approval for
approvedbooleanboolean set to true if function call is successful, false revokes access
vuint8recovery byte of the signature
rbytes32half of the ECDSA signature pair
sbytes32half of the ECDSA signature pair