This smart contract provides a way for group members to assert, on chain, their intention to become a member of a Provenance Blockchain Group.
This solves an issue in the groups module: any admin of any group can add a member to a group without their knowledge.
In order to create an ecosystem that respects group member involvement, this grants group members the ability to
explicitly state that they intended to become a member of a group.
For more information on the internal composition of the contract, view the published documentation.
To instantiate a new instance of the contract, the following parameters are required:
contract_name
: This name will identify the contract when separate instances are deployed on chain. It can be found via thequery_contract_state
query.attribute_name
: The Provenance Blockchain Name Module name that will be bound to the contract. When theapprove_group_membership
execution route is invoked, a Provenance Blockchain Attribute will be bound to the invoking account that includes the specified group id as its INT value.bind_attribute_name
: If specified astrue
, the value specified inattribute_name
will be automatically bound as a Provenance Blockchain Name to the contract during the instantiation process. If this is omitted, the same name specified inattribute_name
must manually be bound after the contract is instantiated. This is useful in circumstances where the name will be bound using a restricted name module namespace.
Example instantiation payload:
{
"contract_name": "Sample identifying name for auxiliary contract",
"attribute_name": "somename.sc.pb",
"bind_attribute_name": true
}
In order for a member to verify their membership in a group, they must simply invoke the contract's sole execution route with the following payload (with the appropriate group id):
{
"approve_group_membership": {
"group_id": "1"
}
}
The contract currently provides a single query route for verifying its version and naming conventions. It can be queried with the following payload:
{
"query_contract_state": {}
}
In order to migrate the contract to new versions, run the migrate command with the following payload:
{
"contract_upgrade": {}
}
This assumes the user is running Mac OSX.
- To start developing with Rust, follow the standard guide.
- The contract uses
wasm-pack
with itsmake build
command. Use this installer command to install it. - To build the contract locally with its
make optimize
, a Docker Environment is also required.