Skip to main content

core.classes.contract_roles

ContractRoles Objects

class ContractRoles()

get_all

def get_all() -> Dict[Role, List[str]]

Get all role members on this contract.

Returns:

a dictionary of role members for each role

get

def get(role: Role) -> List[str]

Get all members of a role on this contract.

Arguments:

  • role: role to get members of

Returns:

list of members of the role

grant

def grant(role: Role, address: str) -> TxReceipt

Grant a role to an address.

Arguments:

  • role: role to grant
  • address: address to grant the role to

Returns:

transaction receipt of granting the role

revoke

def revoke(role: Role, address: str) -> TxReceipt

Revoke a role from an address.

Arguments:

  • role: role to revoke
  • address: address to revoke the role from

Returns:

transaction receipt of revoking the role