Closed EGreg closed 2 years ago
done.
when admin grant role to user, user will obtain personal nft token with tokenID = roleIndex >>180+[userwallet]
admin(or who can manage this role) can set roleURI (method setRoleURI
) that can be used as tokenURI for all tokens
belong to role.
Also user can set personal tokenURI by calling setExtraURI
We want to implement the ERC721 standard so people can see their roles in different communities as NFTs in their wallet.
The
tokenId
would basically be theroleName + ":" + (++counter[roleName])
and callingownerOf(tokenId)
would return the member of that role.All calls to
transferFrom
andsafeTransferFrom
would revert with error "Cannot Transfer Role", unless the role being transferred can manage that role itself (it was added bymanageRole
) andtx.origin
has that role, in which case the transfer would succeed, i.e. by transferring this NFT people can transfer their role to some other account (we remove them from the role and add the other account to the role).Add methods
name()
andsymbol()
to be the name and symbol of the community. Thename
andsymbol
should be passed to constructor, orinitialize()
method if produced byCommunityFactory
contract.We should also be able to set
tokenURI
which would be the URL returned from Add atokenURI(tokenId)
method which would return the URL about the role. For example, being a member of a community, you would typically have logo of community, overlaid with badge of being a member, and the community is supposed to be hosting this logo.