{"id":26911549,"url":"https://github.com/blockscapenetwork/hackatom_v","last_synced_at":"2025-04-01T14:39:07.157Z","repository":{"id":56397498,"uuid":"305639204","full_name":"BlockscapeNetwork/hackatom_v","owner":"BlockscapeNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-28T12:46:17.000Z","size":1171,"stargazers_count":18,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-08-06T13:22:25.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlockscapeNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-AGPL.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-20T08:23:13.000Z","updated_at":"2023-07-05T15:22:04.000Z","dependencies_parsed_at":"2022-08-15T18:00:35.846Z","dependency_job_id":null,"html_url":"https://github.com/BlockscapeNetwork/hackatom_v","commit_stats":null,"previous_names":[],"tags_count":11,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fhackatom_v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fhackatom_v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fhackatom_v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlockscapeNetwork%2Fhackatom_v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlockscapeNetwork","download_url":"https://codeload.github.com/BlockscapeNetwork/hackatom_v/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246657580,"owners_count":20813041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-01T14:39:06.498Z","updated_at":"2025-04-01T14:39:07.150Z","avatar_url":"https://github.com/BlockscapeNetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cosmons - An NFT Example for Managing Digital Collectibles\n\n## How to Build\n\nIn order to optimize your smart contracts, you have to use:\n\n```shell\ndocker run --rm -v \"$(pwd)\":/code \\\n  --mount type=volume,source=\"$(basename \"$(pwd)\")_cache\",target=/code/target \\\n  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \\\n  cosmwasm/workspace-optimizer:0.10.4\n```\n\n## How to Work with REPL\n\n`npx @cosmjs/cli@^0.23 --init contracts/cosmons/helpers.ts`\n\n:warning: Please, keep in mind that helper.ts uses a local wasmd 0.11.1 instance (localnetOptions). Please, update your parameters accordingly.\n\nFor hackatom net, you need to use `defaultOptions` in useOptions.\n\n### Using a contract\n\n```typescript\n// Hackatom_V Net\nconst client = await useOptions(defaultOptions).setup(\u003cYOUR PASSWORD\u003e);\nconst partner = await useOptions(defaultOptions).setup(\u003cYOUR PASSWORD\u003e, \"/Users/user/.hackatom2.key\");\n\n// localnet\nconst client = await useOptions(localnetOptions).setup(\u003cYOUR PASSWORD\u003e, \"/Users/user/localnet.key\");\nconst partner = await useOptions(localnetOptions).setup(\u003cYOUR PASSWORD\u003e, \"/Users/user/localnet2.key\");\n\nconst address = client.senderAddress;\nconst partnerAddr = partner.senderAddress;\n```\n\n### Get the Factory\n\n```typescript\nconst cw721 = CW721(client);\n```\n\n### Verify Funds in the Account\n\n```typescript\nclient.getAccount()\npartner.getAccount()\n```\n\n### Use Existing Accounts\n\nYou can skip this section if followed this transcript up until here.\n\n```typescript\nconst fred = \"cosmos1rgd5jtgp22vq44xz4c69x5z9mu0q92ujcnqdgw\";\nconst bob = \"cosmos1exmd9ml0adgkuggd6knqcjgw4e3x84r4hhfr07\";\n```\n\nQuery accounts:\n`wasmcli query account $(wasmcli keys show -a fred)`\n`wasmcli query account $(wasmcli keys show -a vhx)`\n\n### Instantiate the Contract\n\n```typescript\nconst codeId = \u003cyour CodeID\u003e; // wasmcli q wasm list-code \u0026 find your contract ID\nconst initMsg = { name: \"Cosmons\", symbol: \"mons\",  minter: address };\nconst contract = await client.instantiate(codeId, initMsg, \"Virtual Cosmons 1\");\n```\n\n**OR**\n\n```typescript\nconst contract = client.getContracts(\u003cyour codeID\u003e); // And check for your contractAddress\n```\n\n### Use Contract\n\n```typescript\nconst mine = cw721.use(contract.contractAddress);\n```\n\n### Mint a Cosmon NFT\n\n```typescript\nmine.mint(\"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\", address, \"Cosmos\", \"Minted Cosmon!\");\n```\n\n### Approve Token Transfer\n\n\u003e :warning: Needs to be called before `transferNft`.\n\n```typescript\nmine.approve(address, \"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\");\n```\n\n### Revoke Token Transfer\n\n\u003e :warning: `transferNft` will not work after using `revoke`.\n\n```typescript\nmine.revoke(address, \"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\");\n```\n\n### Transfer Token to Partner\n\n\u003e :warning: Needs to be called after `approve`.\n\n```typescript\nmine.transferNft(partnerAddr, \"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\");\n```\n\n#### Queries\n\n```typescript\nmine.nftInfo(\"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\")\nmine.ownerOf(\"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\")\nmine.numTokens()\nmine.tokens(address, \"\", 10)\nmine.allNftInfo(\"monster112a9lf95atqvyejqe22xnna8x4mfqd75tkq2kvwcjyysarcsb\")\nmine.allTokens(\"\", 10)\n```\n\n### Errata\n\nFaucet is not supported.\n\n## Licenses\n\nThis repo contains two license, [Apache 2.0](./LICENSE-APACHE) and\n[AGPL 3.0](./LICENSE-AGPL.md). All crates in this repo may be licensed\nas one or the other. Please check the `NOTICE` in each crate or the \nrelevant `Cargo.toml` file for clarity.\n\nAll *specifications* will always be Apache-2.0. All contracts that are\nmeant to be *building blocks* will also be Apache-2.0. This is along\nthe lines of Open Zepellin or other public references.\n\nContracts that are \"ready to deploy\" may be licensed under AGPL 3.0 to \nencourage anyone using them to contribute back any improvements they\nmake. This is common practice for actual projects running on Ethereum,\nlike Uniswap or Maker DAO.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockscapenetwork%2Fhackatom_v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockscapenetwork%2Fhackatom_v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockscapenetwork%2Fhackatom_v/lists"}