TWFactory

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

Name
Type
Description

_0

bytes32

undefined

FACTORY_ROLE

function FACTORY_ROLE() external view returns (bytes32)

Only FACTORY_ROLE holders can approve/unapprove implementations for proxies to point to.

Returns

Name
Type
Description

_0

bytes32

undefined

addImplementation

function addImplementation(address _implementation) external nonpayable

Lets a contract admin set the address of a contract type x version.

Parameters

Name
Type
Description

_implementation

address

undefined

approval

mapping of implementation address to deployment approval

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

approveImplementation

Lets a contract admin approve a specific contract for deployment.

Parameters

Name
Type
Description

_implementation

address

undefined

_toApprove

bool

undefined

currentVersion

mapping of implementation address to implementation added version

Parameters

Name
Type
Description

_0

bytes32

undefined

Returns

Name
Type
Description

_0

uint256

undefined

deployProxy

Deploys a proxy that points to the latest version of the given contract type.

Parameters

Name
Type
Description

_type

bytes32

undefined

_data

bytes

undefined

Returns

Name
Type
Description

_0

address

undefined

deployProxyByImplementation

Deploys a proxy that points to the given implementation.

Parameters

Name
Type
Description

_implementation

address

undefined

_data

bytes

undefined

_salt

bytes32

undefined

Returns

Name
Type
Description

deployedProxy

address

undefined

deployProxyDeterministic

Deploys a proxy at a deterministic address by taking in salt as a parameter. Proxy points to the latest version of the given contract type.

Parameters

Name
Type
Description

_type

bytes32

undefined

_data

bytes

undefined

_salt

bytes32

undefined

Returns

Name
Type
Description

_0

address

undefined

deployer

mapping of proxy address to deployer address

Parameters

Name
Type
Description

_0

address

undefined

Returns

Name
Type
Description

_0

address

undefined

getImplementation

Returns the implementation given a contract type and version.

Parameters

Name
Type
Description

_type

bytes32

undefined

_version

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

getLatestImplementation

Returns the latest implementation given a contract type.

Parameters

Name
Type
Description

_type

bytes32

undefined

Returns

Name
Type
Description

_0

address

undefined

getRoleAdmin

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

Name
Type
Description

role

bytes32

undefined

Returns

Name
Type
Description

_0

bytes32

undefined

getRoleMember

Returns one of the accounts that have role. index must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.

Parameters

Name
Type
Description

role

bytes32

undefined

index

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

getRoleMemberCount

Returns the number of accounts that have role. Can be used together with {getRoleMember} to enumerate all bearers of a role.

Parameters

Name
Type
Description

role

bytes32

undefined

Returns

Name
Type
Description

_0

uint256

undefined

grantRole

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role. May emit a {RoleGranted} event.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

hasRole

Returns true if account has been granted role.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

implementation

mapping of contract type to module version to implementation address

Parameters

Name
Type
Description

_0

bytes32

undefined

_1

uint256

undefined

Returns

Name
Type
Description

_0

address

undefined

isTrustedForwarder

Parameters

Name
Type
Description

forwarder

address

undefined

Returns

Name
Type
Description

_0

bool

undefined

multicall

Receives and executes a batch of function calls on this contract.

Parameters

Name
Type
Description

data

bytes[]

undefined

Returns

Name
Type
Description

results

bytes[]

undefined

registry

Returns

Name
Type
Description

_0

contract TWRegistry

undefined

renounceRole

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account. May emit a {RoleRevoked} event.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

revokeRole

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role. May emit a {RoleRevoked} event.

Parameters

Name
Type
Description

role

bytes32

undefined

account

address

undefined

supportsInterface

See {IERC165-supportsInterface}.

Parameters

Name
Type
Description

interfaceId

bytes4

undefined

Returns

Name
Type
Description

_0

bool

undefined

Events

ImplementationAdded

Parameters

Name
Type
Description

implementation

address

undefined

contractType indexed

bytes32

undefined

version

uint256

undefined

ImplementationApproved

Parameters

Name
Type
Description

implementation

address

undefined

isApproved

bool

undefined

ProxyDeployed

Emitted when a proxy is deployed.

Parameters

Name
Type
Description

implementation indexed

address

undefined

proxy

address

undefined

deployer indexed

address

undefined

RoleAdminChanged

Parameters

Name
Type
Description

role indexed

bytes32

undefined

previousAdminRole indexed

bytes32

undefined

newAdminRole indexed

bytes32

undefined

RoleGranted

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

RoleRevoked

Parameters

Name
Type
Description

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

Last updated