https://github.com/lastmjs/simple-sns
https://github.com/lastmjs/simple-sns
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lastmjs/simple-sns
- Owner: lastmjs
- License: mit
- Created: 2021-10-12T22:53:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T19:42:23.000Z (over 3 years ago)
- Last Synced: 2025-02-10T11:09:52.160Z (4 months ago)
- Language: Rust
- Size: 153 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-sns
## Development
### Prepare token
```bash
# Clone the extendable-token repository as a sibling of the simple-sns repository
git clone [email protected]:Toniq-Labs/extendable-token.git# Find the principal of the identity you would like to send the initial supply of the token to
# In this case, I have chosen l3x6q-t2lwb-aryfe-q5guh-5a2ry-vs6ie-mb6ic-phtci-ltcnz-ulj25-jae
dfx deploy token --argument="(\"Token\", \"TOK\", 3, 1000000:nat, principal \"l3x6q-t2lwb-aryfe-q5guh-5a2ry-vs6ie-mb6ic-phtci-ltcnz-ulj25-jae\")"
```### Prepare governance canister
```bash
dfx deploy governance# Find the canister id of the previously-created token canister
# In this case, the token canister id is: renrk-eyaaa-aaaaa-aaada-cai
# The parameters are as follows: num_tokens_to_create_proposal, target_canister_id, threshold_to_adopt, token_principal
# Look at the configure function in the canister to understand these parameters better
dfx canister call governance configure '(1, null, .5, "renrk-eyaaa-aaaaa-aaada-cai")'
```### Proposals
```bash
# Creates a proposal to create an empty canister
dfx canister call governance create_proposal '(variant { CANISTER_CREATE }, "Create a canister", "https://google.com", blob "")'
```### Votes
```bash
# This casts an adopt vote for proposal with id 7ktvvp-sjrui-i4xf3-j7nxy-z4x6s-zsulr-nluy5-wcd5t-qnqc
dfx canister call governance cast_vote '("7ktvvp-sjrui-i4xf3-j7nxy-z4x6s-zsulr-nluy5-wcd5t-qnqc", true)'
```