ProtocolConfig

ProtocolConfig stores configuration associated with the OpenGuild protocol, including take rates and contract address whitelists

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription

_0

bytes32

undefined

OWNER_ROLE

function OWNER_ROLE() external view returns (bytes32)

Returns

NameTypeDescription

_0

bytes32

undefined

PAUSER_ROLE

function PAUSER_ROLE() external view returns (bytes32)

Returns

NameTypeDescription

_0

bytes32

undefined

POOL_MANAGER_TAKE_RATE

function POOL_MANAGER_TAKE_RATE() external view returns (uint256)

Returns

NameTypeDescription

_0

uint256

undefined

PROTOCOL_TAKE_RATE

function PROTOCOL_TAKE_RATE() external view returns (uint256)

Returns

NameTypeDescription

_0

uint256

undefined

TAKE_RATE_PRECISION

function TAKE_RATE_PRECISION() external view returns (uint256)

Returns

NameTypeDescription

_0

uint256

undefined

__BaseUpgradeablePausable__init

function __BaseUpgradeablePausable__init(address owner) external nonpayable

Parameters

NameTypeDescription

owner

address

undefined

__PauserPausable__init

function __PauserPausable__init() external nonpayable

addAggregatePool

function addAggregatePool(address pool) external nonpayable

Adds the given aggregate pool to the array of validAggregatePoolsOnly callable by the admin

Parameters

NameTypeDescription

pool

address

An aggregate pool that the protocol adds

addIndividualPool

function addIndividualPool(address pool) external nonpayable

Adds the given individual pool to the array of validIndividualPoolsOnly callable by the admin

Parameters

NameTypeDescription

pool

address

An individual pool that the protocol adds

addresses

function addresses(uint256) external view returns (address)

Parameters

NameTypeDescription

_0

uint256

undefined

Returns

NameTypeDescription

_0

address

undefined

getAddress

function getAddress(uint256 index) external view returns (address)

The address at a given index

Parameters

NameTypeDescription

index

uint256

The index of the address

Returns

NameTypeDescription

_0

address

Returns the address at the given index

getGovernanceTokenContract

function getGovernanceTokenContract() external view returns (contract GovernanceToken)

Returns the governance token contract

Returns

NameTypeDescription

_0

contract GovernanceToken

The protocol's governance token contract

getPoolManagerTakeRate

function getPoolManagerTakeRate() external pure returns (uint256)

Returns

NameTypeDescription

_0

uint256

The protocol wide pool manager take rate

getProtocolTakeRate

function getProtocolTakeRate() external pure returns (uint256)

Returns

NameTypeDescription

_0

uint256

The protocol wide take rate

getRoleAdmin

function getRoleAdmin(bytes32 role) external view returns (bytes32)

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

Parameters

NameTypeDescription

role

bytes32

undefined

Returns

NameTypeDescription

_0

bytes32

undefined

getRoleMember

function getRoleMember(bytes32 role, uint256 index) external view returns (address)

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

NameTypeDescription

role

bytes32

undefined

index

uint256

undefined

Returns

NameTypeDescription

_0

address

undefined

getRoleMemberCount

function getRoleMemberCount(bytes32 role) external view returns (uint256)

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

Parameters

NameTypeDescription

role

bytes32

undefined

Returns

NameTypeDescription

_0

uint256

undefined

getTakeRatePrecision

function getTakeRatePrecision() external pure returns (uint256)

Returns

NameTypeDescription

_0

uint256

The protocol wide take rate precision

getTreasuryAddress

function getTreasuryAddress() external view returns (address)

Returns the governance token contract

Returns

NameTypeDescription

_0

address

The OpenGuild treasury address

grantRole

function grantRole(bytes32 role, address account) external nonpayable

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.

Parameters

NameTypeDescription

role

bytes32

undefined

account

address

undefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription

role

bytes32

undefined

account

address

undefined

Returns

NameTypeDescription

_0

bool

undefined

initialize

function initialize(address _owner, address _treasury) external nonpayable

Run only once, on initialization

Parameters

NameTypeDescription

_owner

address

The address of who should have the "OWNER_ROLE" of this contract

_treasury

address

The address of the OpenGuild treasury

isAdmin

function isAdmin() external view returns (bool)

Returns

NameTypeDescription

_0

bool

undefined

isValidAggregatePool

function isValidAggregatePool(address pool) external view returns (bool)

Parameters

NameTypeDescription

pool

address

The aggregate pool being checked

Returns

NameTypeDescription

_0

bool

Whether or not the aggregate pool is valid

isValidIndividualPool

function isValidIndividualPool(address pool) external view returns (bool)

Whether or not the individual pool is valid

Parameters

NameTypeDescription

pool

address

The individual pool being checked

Returns

NameTypeDescription

_0

bool

Whether or not the given address is a valid individual pool

pause

function pause() external nonpayable

Pauses all functions guarded by Pause See {Pausable-_pause}. Requirements: - the caller must have the PAUSER_ROLE.

paused

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns

NameTypeDescription

_0

bool

undefined

removeAggregatePool

function removeAggregatePool(address pool) external nonpayable

Removes the given aggregate pool from the array of validAggregatePoolsOnly callable by the admin

Parameters

NameTypeDescription

pool

address

An aggregate pool that the protocol removes

removeIndividualPool

function removeIndividualPool(address pool) external nonpayable

Removes the given individual pool from the array of validIndividualPoolsOnly callable by the admin

Parameters

NameTypeDescription

pool

address

An individual pool that the protocol removes

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

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.

Parameters

NameTypeDescription

role

bytes32

undefined

account

address

undefined

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

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

Parameters

NameTypeDescription

role

bytes32

undefined

account

address

undefined

setGovernanceTokenAddress

function setGovernanceTokenAddress(address newGovernanceTokenAddress) external nonpayable

Sets the governance token address in the addresses mappingOnly callable by the admin

Parameters

NameTypeDescription

newGovernanceTokenAddress

address

The governance token address

setTreasuryAddress

function setTreasuryAddress(address newTreasuryAddress) external nonpayable

Sets the treasury address in the addresses mappingOnly callable by the admin

Parameters

NameTypeDescription

newTreasuryAddress

address

The treasury address

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription

interfaceId

bytes4

undefined

Returns

NameTypeDescription

_0

bool

undefined

unpause

function unpause() external nonpayable

Unpauses the contract See {Pausable-_unpause}. Requirements: - the caller must have the Pauser role

validAggregatePools

function validAggregatePools(address) external view returns (bool)

Parameters

NameTypeDescription

_0

address

undefined

Returns

NameTypeDescription

_0

bool

undefined

validIndividualPools

function validIndividualPools(address) external view returns (bool)

Parameters

NameTypeDescription

_0

address

undefined

Returns

NameTypeDescription

_0

bool

undefined

Events

Paused

event Paused(address account)

Parameters

NameTypeDescription

account

address

undefined

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription

role indexed

bytes32

undefined

previousAdminRole indexed

bytes32

undefined

newAdminRole indexed

bytes32

undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription

role indexed

bytes32

undefined

account indexed

address

undefined

sender indexed

address

undefined

Unpaused

event Unpaused(address account)

Parameters

NameTypeDescription

account

address

undefined

Last updated