Dapp-a-day 14: DSRoles – a DSAuthority that manages up to 256 roles

in #ethereum8 years ago (edited)

dapp-a-day-14 2x


Each weekday leading up to devcon2, Nexus will highlight a dapp, library, or package (something with a dappfile) as a promotion of our toolchain and as case studies for other developers. Previous Post

Today's dapp contains a DSAuthority that manages up to 256 roles.

In the context of the Role Authority, a user is the sender,
while a capability is a (code,sig) :: (bytes32,bytes4) pair.

https://github.com/nexusdev/ds-roles

The ability to check permissions in constant time is entirely due to the artificial constraint on number of roles.

256 was chosen because this lets us abuse the large word size and cheap native bitwise operators.


https://nexusdev.us
https://github.com/nexusdev

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.034
BTC 66038.71
ETH 3178.89
USDT 1.00
SBD 4.05