Skip to main content
B20 is an ERC-20 superset with built-in role-based access control. Its role API uses familiar admin, grant, revoke, and renounce patterns, but B20 only enforces the built-in roles listed here.

Base roles

User-defined roles have no built-in enforcement. You can create them with setRoleAdmin and grant them with grantRole, but B20 token functions only check the built-in roles.

Admin renunciation

B20 has a specific last-admin rule. The last DEFAULT_ADMIN_ROLE holder cannot renounce or be revoked through normal role methods; those calls revert with LastAdminCannotRenounce. Use renounceLastAdmin() to permanently move the token to an admin-less state. A token can also launch admin-less by passing initialAdmin == address(0) at creation. After admin renunciation:
  • DEFAULT_ADMIN_ROLE-gated operations are permanently uncallable.
  • Existing operational role grants continue to work.
  • Admin resurrection is blocked; grantRole, revokeRole, and setRoleAdmin revert even through custom admin-role chains.

Pre-renunciation checklist

Configure every surviving operational path before renouncing the last admin.
For an admin-less launch from creation, put the required grants and policy updates in initCalls, then set initialAdmin to address(0) in the create params.

Deployment & initCalls encoding

IB20 reference