Skip to main content

MasterContractManager

Methods

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

claimOwnership

function claimOwnership() external nonpayable

Needs to be called by pendingOwner to claim ownership.

deploy

function deploy(address masterContract, bytes data, bool useCreate2) external payable returns (address cloneAddress)

Deploys a given master Contract as a clone. Any ETH transferred with this call is forwarded to the new clone. Emits LogDeploy.

Parameters

NameTypeDescription
masterContractaddressThe address of the contract to clone.
databytesAdditional abi encoded calldata that is passed to the new clone via IMasterContract.init.
useCreate2boolCreates the clone by using the CREATE2 opcode, in this case data will be used as salt.

Returns

NameTypeDescription
cloneAddressaddressAddress of the created clone contract.

masterContractApproved

function masterContractApproved(address, address) external view returns (bool)

masterContract to user to approval state

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined

Returns

NameTypeDescription
_0boolundefined

masterContractOf

function masterContractOf(address) external view returns (address)

Mapping from clone contracts to their masterContract.

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0addressundefined

nonces

function nonces(address) external view returns (uint256)

user nonces for masterContract approvals

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

owner

function owner() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

pendingOwner

function pendingOwner() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

registerProtocol

function registerProtocol() external nonpayable

Other contracts need to register with this master contract so that users can approve them for the BentoBox.

setMasterContractApproval

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

Approves or revokes a masterContract access to user funds.

Parameters

NameTypeDescription
useraddressThe address of the user that approves or revokes access.
masterContractaddressThe address who gains or loses access.
approvedboolIf True approves access. If False revokes access.
vuint8Part of the signature. (See EIP-191)
rbytes32Part of the signature. (See EIP-191)
sbytes32Part of the signature. (See EIP-191)

transferOwnership

function transferOwnership(address newOwner, bool direct, bool renounce) external nonpayable

Transfers ownership to newOwner. Either directly or claimable by the new pending owner. Can only be invoked by the current owner.

Parameters

NameTypeDescription
newOwneraddressAddress of the new owner.
directboolTrue if newOwner should be set immediately. False if newOwner needs to use claimOwnership.
renounceboolAllows the newOwner to be address(0) if direct and renounce is True. Has no effect otherwise.

whitelistMasterContract

function whitelistMasterContract(address masterContract, bool approved) external nonpayable

Enables or disables a contract for approval without signed message.

Parameters

NameTypeDescription
masterContractaddressundefined
approvedboolundefined

whitelistedMasterContracts

function whitelistedMasterContracts(address) external view returns (bool)

masterContract to whitelisted state for approval without signed message

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0boolundefined

Events

LogDeploy

event LogDeploy(address indexed masterContract, bytes data, address indexed cloneAddress)

Parameters

NameTypeDescription
masterContract indexedaddressundefined
databytesundefined
cloneAddress indexedaddressundefined

LogRegisterProtocol

event LogRegisterProtocol(address indexed protocol)

Parameters

NameTypeDescription
protocol indexedaddressundefined

LogSetMasterContractApproval

event LogSetMasterContractApproval(address indexed masterContract, address indexed user, bool approved)

Parameters

NameTypeDescription
masterContract indexedaddressundefined
user indexedaddressundefined
approvedboolundefined

LogWhiteListMasterContract

event LogWhiteListMasterContract(address indexed masterContract, bool approved)

Parameters

NameTypeDescription
masterContract indexedaddressundefined
approvedboolundefined

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined