{"id":22642766,"url":"https://github.com/bit-nation/nation-framework","last_synced_at":"2026-05-03T12:32:12.694Z","repository":{"id":86732920,"uuid":"113877124","full_name":"Bit-Nation/nation-framework","owner":"Bit-Nation","description":"The Nation Framework, allowing everyone to create their own DBVN on Pangea","archived":false,"fork":false,"pushed_at":"2018-03-28T14:12:07.000Z","size":918,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":10,"default_branch":"development","last_synced_at":"2025-08-23T02:50:43.441Z","etag":null,"topics":["ethereum","nationbuilder","smart-contracts","solidity","truffle"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bit-Nation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-11T15:41:11.000Z","updated_at":"2018-12-30T22:46:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"dcae4c02-db54-48aa-896e-469a9bbf1a1a","html_url":"https://github.com/Bit-Nation/nation-framework","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Bit-Nation/nation-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Nation%2Fnation-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Nation%2Fnation-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Nation%2Fnation-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Nation%2Fnation-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bit-Nation","download_url":"https://codeload.github.com/Bit-Nation/nation-framework/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bit-Nation%2Fnation-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32569712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","nationbuilder","smart-contracts","solidity","truffle"],"created_at":"2024-12-09T05:08:23.481Z","updated_at":"2026-05-03T12:32:12.673Z","avatar_url":"https://github.com/Bit-Nation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitnation Nation Framework\n\n## Credits\nWe took a lot of inspiration (e.g. upgradable smart contracts) from the [aragon](https://aragon.one/) code base and architecture (and some files are just copied over since they are the solution we need). It's a great project and you should [check it out](https://aragon.one/) if you are interested in DAO's.\n\n## Interface for use\n\n### Nations Contract\nTo deploy the nations contract, run `truffle migrate --network live` which will take care of \nsetting up all of the proxy to implementation connections. To actually get an instance of the nations\ncontract, you need to fetch the instance of the proxy with the Nations wrapper. Do this with\n`nationInstance = Nation.at(nationProxy.address)`\n!Important Make sure you get the implementation this way, otherwise the nation will not be upgradable \nAfter you get the implementation, you can interact with it in the following ways:\n\n#### Upgrading the nations contract\nTo upgrade the nations contract, make sure you are the current owner of the contract. You can check with a simple\n`nationInstance.owner()`, since owner is a public state variable. You can change the owner of the contract with \n`nationInstance.changeOwner(address newOwner)` which will fire off a `OwnerChanged(address indexed newOwner)` event.\nNote that this function can only be called from the current owner.\n\nYou can also check the current version with `nationInstance.NationCoreVersion()`.\n\nTo upgrade the nation, run `nationInstance.upgradeNation(address newNationContract)` with the address of the deployed\nnew nation contract. This will fire off a `UpgradeNation(address indexed newNation)` event\n\n#### Creating and setting a nation's properties\n\nCreate a nation by passing in a serialized JSON object of it's properties:\n`nationInstance.createNation('{nationMame: USA...}')`\nThis will fire off a `NationCreated(address indexed founder, uint indexed nationId)` event.\nKeep track of the nation Id because that is what you will be using to interface with your nation from now on.\n\n#### Getting a nation's properties  \nYou can get a nation's metadata by calling\n`nationInstance.getNationMetaData(uint nationId)`, which will return the metadata of the specified nation                                                                                                                                                                                \n\nYou can also use assistant functions to get other data from nations:\n`nationInstance.numNations()`, which returns the current number of nations that exist.\n`nationInstance.getFoundedNations(address founder)`, which returns an array of nation ids that the founder has created.\n\n#### Citizen management\nCitizens can join or leave a nation with the following commands:\n`nationInstance.joinNation(uint nationId)` and\n`nationInstance.leaveNation(uint nationId)` which will fire off\n`CitizenJoined(uint indexed nationId, address citizenAddress)` and `CitizenLeft(uint indexed nationId, address citizenAddress)` events respectively.\n\n\nYou can check if a citizen is a member of a nation with the constant function:\n`nationInstance.checkCitizen(address citizenAddress, uint nationId)`\n\nYou can get the number of citizens in a nation with the constant function:\n`nationInstance.getNumCitizens(uint nationId)`\n\n\n\n\n### Token Registry\nThe token registry refers to nations in the nations contract with their nationId. Multiple tokens can be created\nfor the same nation, and can have the same name. The only truly unique identifier of any token is it's address. All generated\ntokens are ERC20 compatible tokens. This contract is very simple in the sense that it only has two functions to interface with it.\n\nYou can create a token for a nation with:\n`createStandardToken(uint nationId, uint initialAmount, string name, uint8 decimals, string symbol)` which will\ncreate a ERC20 standard token and will emit a `TokenCreated(address tokenAddress, string tokenName, uint indexed nationId)` event.\n\nYou can get all of the tokens under a nation with the constant function:\n`getTokensForNation(uint nationId)`\nwhich will return an array of addresses\n\nTo interface with any of the tokens, you can just use the address as well as the NationStandardToken contract.\nToken properties include: \n\nstring public name;                   \nuint public nationId;                 \nuint8 public decimals;            \nstring public symbol;\n\nwhich are all public variables so they can easily be accessed.\n\n## Development\n\n### Docker\n1. Get docker\n2. Run `docker-compose up` to start the container's\n3. Run `docker-compose exec node bash` to enter the node env. DONT RUN ANY COMMAND FROM YOUR LOCAL ENV.\n4. Run `exit` to exit from the node container's\n5. Run `docker-compose stop` to turn shut down the container's. \n6. Run `docker-compose start` to start the container's\n7. Run `docker-compose down` to destroy the container's.\n8. Run `docker-compose build` to rebuild the images (you need this when you change thing's in the Dockerfile's)\n\n### Testing\n1. To run the tests, use `npm run test` inside the docker node env\n2. To run coverage, use `npm run coverage` inside the docker node env\n\n### Git \n- We are using [this](http://nvie.com/posts/a-successful-git-branching-model/) git workflow. Make sure you read it. \n- PLEASE prefix your git commit's with a topic like so: `[git] blacklisted .idea folder`\n- Make SMALL commit's. It's then way better to follow your changes. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbit-nation%2Fnation-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbit-nation%2Fnation-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbit-nation%2Fnation-framework/lists"}