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.22
TRX 0.26
JST 0.040
BTC 97876.97
ETH 3483.25
USDT 1.00
SBD 3.26