
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
@intercoin/community
Advanced tools
This repository contains the Community Contract, a smart contract that manages roles and permissions within a community.
You can clone the repository from GitHub:
git clone git@github.com:Intercoin/CommunityContract.git
or install it using npm:
npm i @artman325/community
Any user can create their own community by calling the produce method of the CommunityFactory contract: produce(hook, invitedHook, name, symbol).
Link for the factory below
There are 6 predefined roles:
| role name | role index |
|---|---|
owners | 1 |
admins | 2 |
members | 3 |
alumni | 4 |
visitors | 5 |
The owners role is a single role that can manage itself, meaning one owner can add or remove other owners.
The contract can be used as external storage for getting a list of members.
Any user obtains an NFT with tokenID = (roleid << 160) + walletaddress.
Anyone who can manage a certain role can set up the tokenURI for this role by calling setRoleURI.
Full methods for each contract can be found here: Community. The most usable methods will be described below:
| method name | called by | description |
|---|---|---|
| grantRoles | Any role which manage "roles" | adding members to new "roles" |
| revokeRoles | Any role which manage "roles" | removing members from "roles". Revert if any roles can not be managed by sender |
| createRole | only `owners` | Creating new role |
| manageRole | only `owners` | allow account with "byRole" setup "ofRole" to any another account |
| getAddresses | anyone | Returns all accounts belong to "role" |
| getRoles | anyone | Returns all roles which account belong to |
| addressesCount | anyone | Returns number of all members belong to "role" |
Adds accounts to new roles. Can be called by any role that manages roles. Reverts if any roles cannot be managed by the sender.
Params:
| name | type | description |
|---|---|---|
| accounts | address[] | account's address |
| roles | uint8[] | indexes of roles |
Removes roles from certain accounts. Can be called by any role that manages roles. Reverts if any roles cannot be managed by the sender.
Params:
| name | type | description |
|---|---|---|
| accounts | address[] | accounts's address |
| roles | uint8[] | indexes of roles |
Creates a new role. Can only be called by owners.
Params:
| name | type | description |
|---|---|---|
| role | string | name of role |
Allows an account with byRole to set up ofRole for another account with the default role (members). Can only be called by owners.
Params:
| name | type | description |
|---|---|---|
| byRole | uint8 | index of source role |
| ofRole | uint8 | index of target role |
| canGrantRole | bool | if true then byRole can grant ofRole to account, overwise - disabled |
| canRevokeRole | bool | if true then byRole can revoke ofRole from account, overwise - disabled |
| requireRole | uint8 | target account should be in role requireRole to be able to obtain ofRole. if zero - then available to everyone |
| maxAddresses | uint256 | amount of addresses that be available to grant in duration period(bucket) if zero - then no limit |
| duration | uint64 | if zero - then no buckets. but if maxAddresses != 0 then it's real total maximum addresses available to grant |
Returns all accounts belonging to a role.
Params:
| name | type | description |
|---|---|---|
| role | uint8 | index of role. |
Returns all roles that a member belongs to.
Params:
| name | type | description |
|---|---|---|
| account | address | account's address. [optional] if not specified returned all roles |
Returns the number of all accounts belonging to a role.
Params:
| name | type | description |
|---|---|---|
| role | uint8 | index of role. |
visit wiki
FAQs
Smart contract for managing community membership and roles
We found that @intercoin/community demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.