{"_id":"@ara-web/smartcontracts","_rev":"2-956762c9a8376057cc431cfe1ce0b450","name":"@ara-web/smartcontracts","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@ara-web/smartcontracts","version":"1.0.0","keywords":["blockchain","smart-contracts","ethereum","open-source","governance","dao","solidity","hardhat","ara","galaxy","stars","tokenomics"],"author":{"name":"Ara Foundation"},"license":"ISC","_id":"@ara-web/smartcontracts@1.0.0","maintainers":[{"name":"ahmetson","email":"medet@ara.foundation"}],"dist":{"shasum":"6c20faf716a17c3ec05e2d914d5ff0ae345e47c1","tarball":"https://registry.npmjs.org/@ara-web/smartcontracts/-/smartcontracts-1.0.0.tgz","fileCount":3,"integrity":"sha512-AMvCPY69HOQOiyGlawtnZglYk9O6wtDbFV42zK+W1EhMFmTKeV1KKRjbxHHTiEsIFtXz74tMaipqv9fDaz8gnA==","signatures":[{"sig":"MEUCIHvLW/yVSbc/J67S/5ZnavpwGYu4QumeT8qyy0CuiFWTAiEA5qeDlTI7+DiEef4hVOpqq7HwFDFj0QbBnuzpq2zCCq8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44198},"main":"./abis.ts","type":"module","types":"./abis.ts","exports":{"./deployed":{"types":"./abis.ts","default":"./abis.ts"}},"gitHead":"a72ae13914ecdbfea41c05493a781029297eb8be","scripts":{"test":"echo \"Error: no test specified\" && exit 1","wagmi":"wagmi generate"},"_npmUser":{"name":"ahmetson","email":"medet@ara.foundation"},"_npmVersion":"11.6.2","description":"Smart contracts for Ara, a blockchain-based platform for open-source project governance and collaboration. Enables decentralized ownership transfer through star-based tokenomics, where projects (galaxies) distribute stars to contributors, maintainers, and","directories":{},"_nodeVersion":"24.12.0","dependencies":{"@wagmi/core":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.5","hardhat":"^3.0.0","@wagmi/cli":"^2.8.0","typescript":"^5.0.0","@types/node":"^20.0.0","@chainlink/contracts":"^1.1.1","@openzeppelin/contracts":"^5.0.2","@openzeppelin/hardhat-upgrades":"^3.9.1","@nomicfoundation/hardhat-ethers":"^4.0.3","@nomicfoundation/hardhat-verify":"^3.0.0","@nomicfoundation/hardhat-toolbox":"^6.0.0","@openzeppelin/contracts-upgradeable":"^5.0.2","@nomicfoundation/hardhat-chai-matchers":"^2.1.0","@nomicfoundation/hardhat-network-helpers":"^3.0.3"},"_npmOperationalInternal":{"tmp":"tmp/smartcontracts_1.0.0_1765669110407_0.5627269130255159","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ara-web/smartcontracts","version":"1.0.1","type":"module","description":"Smart contracts for Ara, a blockchain-based platform for open-source project governance and collaboration. Enables decentralized ownership transfer through star-based tokenomics, where projects (galaxies) distribute stars to contributors, maintainers, and","main":"./abis.ts","types":"./abis.ts","exports":{".":{"types":"./abis.ts","default":"./abis.ts"}},"publishConfig":{"access":"public"},"scripts":{"test":"node test/imports.test.js","wagmi":"wagmi generate"},"keywords":["blockchain","smart-contracts","ethereum","open-source","governance","dao","solidity","hardhat","ara","galaxy","stars","tokenomics"],"author":{"name":"Ara Foundation"},"license":"ISC","devDependencies":{"@chainlink/contracts":"^1.1.1","@nomicfoundation/hardhat-chai-matchers":"^2.1.0","@nomicfoundation/hardhat-ethers":"^4.0.3","@nomicfoundation/hardhat-network-helpers":"^3.0.3","@nomicfoundation/hardhat-toolbox":"^6.0.0","@nomicfoundation/hardhat-verify":"^3.0.0","@openzeppelin/contracts":"^5.0.2","@openzeppelin/contracts-upgradeable":"^5.0.2","@openzeppelin/upgrades-core":"^1.44.2","@types/node":"^20.0.0","@wagmi/cli":"^2.8.0","dotenv":"^16.4.5","ethers":"^6.16.0","hardhat":"^3.0.0","typescript":"^5.0.0"},"dependencies":{"@wagmi/core":"^3.0.0"},"gitHead":"57e55aad736918d3ddc78e1b9b3d82e0741f16e2","_id":"@ara-web/smartcontracts@1.0.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-OBEYLOvlvOgLgu8J4UEuvXvklomwp86ePKVnsX6AqYU+TPaIyBLgHLGRZc9qxKl3nAzFZaRBQl/H5Vh2rBEgzA==","shasum":"78935435df2731d96e8529216b08d6ff616b1d28","tarball":"https://registry.npmjs.org/@ara-web/smartcontracts/-/smartcontracts-1.0.1.tgz","fileCount":3,"unpackedSize":48899,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBRaiPo3ABW94/6Wo9gMynKJRP+Pda+wTyXOjrf8zpwgAiB3RLtVeGcyvkeOKcZyqoGrhXBGS9CcgskbutT4ExeKBA=="}]},"_npmUser":{"name":"ahmetson","email":"medet@ara.foundation"},"directories":{},"maintainers":[{"name":"ahmetson","email":"medet@ara.foundation"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smartcontracts_1.0.1_1765740583924_0.06276193822538079"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-13T23:38:30.289Z","modified":"2025-12-14T19:29:44.257Z","1.0.0":"2025-12-13T23:38:30.560Z","1.0.1":"2025-12-14T19:29:44.063Z"},"author":{"name":"Ara Foundation"},"license":"ISC","keywords":["blockchain","smart-contracts","ethereum","open-source","governance","dao","solidity","hardhat","ara","galaxy","stars","tokenomics"],"description":"Smart contracts for Ara, a blockchain-based platform for open-source project governance and collaboration. Enables decentralized ownership transfer through star-based tokenomics, where projects (galaxies) distribute stars to contributors, maintainers, and","maintainers":[{"name":"ahmetson","email":"medet@ara.foundation"}],"readme":"# Ara SmartContracts\nRepresenting open-source projects as galaxies, while users as stars.\n\n### What is Ara?\nIn Ara, every open-source project is called a galaxy. Once the user's issue is resolved, galaxy distributes the stars to the user, maintainer and contributor. Your goal as the project community is to gather as much stars as possible. Once, star amount exceeds a certain threshold, open-source project in Ara changes it's owner to the star owners: users, collaborators along with the maintainers.\n\nTo learn more, and what benefit it has for open-source projects Check the website: https://ara.foundation/\n\n## Getting Started\n\nInstall the package:\n\n```bash\nnpm install @ara-web/smartcontracts\n```\n\n### Using the Contract ABIs\n\nImport the deployed contract ABIs and types in your application:\n\n```typescript\nimport { allStarsAbi } from '@ara-web/smartcontracts/deployed';\n```\n\n### Use Cases\n\n#### 1. Reading Contract Data\n\n```typescript\nimport { createReadContract } from '@wagmi/core';\nimport { allStarsAbi } from '@ara-web/smartcontracts/deployed';\nimport { baseSepolia } from 'wagmi/chains';\n\n// Read galaxy data\nconst galaxyData = await createReadContract({\n  address: '0x70b089840FB3D567C5d618b222503d68A8ad0dAa',\n  abi: allStarsAbi,\n  functionName: 'galaxies',\n  args: [galaxyId],\n  chainId: baseSepolia.id,\n});\n```\n\n#### 2. Writing to Contracts\n\n```typescript\nimport { createWriteContract } from '@wagmi/core';\nimport { allStarsAbi } from '@ara-web/smartcontracts/deployed';\n\n// Add a new galaxy (backend only)\nawait createWriteContract({\n  address: '0x70b089840FB3D567C5d618b222503d68A8ad0dAa',\n  abi: allStarsAbi,\n  functionName: 'addGalaxy',\n  args: [/* galaxy parameters */],\n});\n```\n\n#### 3. Listening to Events\n\n```typescript\nimport { createWatchContractEvent } from '@wagmi/core';\nimport { allStarsAbi } from '@ara-web/smartcontracts/deployed';\n\n// Watch for new galaxies\ncreateWatchContractEvent({\n  address: '0x70b089840FB3D567C5d618b222503d68A8ad0dAa',\n  abi: allStarsAbi,\n  eventName: 'GalaxyAdded',\n  onLogs(logs) {\n    console.log('New galaxy added:', logs);\n  },\n});\n```\n\n#### 4. With React and wagmi\n\n```typescript\nimport { useReadContract, useWriteContract } from 'wagmi';\nimport { allStarsAbi } from '@ara-web/smartcontracts/deployed';\n\nfunction GalaxyInfo({ galaxyId }: { galaxyId: number }) {\n  const { data: galaxy } = useReadContract({\n    address: '0x70b089840FB3D567C5d618b222503d68A8ad0dAa',\n    abi: allStarsAbi,\n    functionName: 'galaxies',\n    args: [galaxyId],\n  });\n\n  return <div>{galaxy?.name}</div>;\n}\n```\n\n---\n\n## Deployed Contracts\n\n### Base Sepolia Network\n\nSmartcontracts to track on blockchain explorers:\n- Etherscan: [All Stars](https://sepolia.basescan.org/address/0x70b089840FB3D567C5d618b222503d68A8ad0dAa)\n- Blockscout: [All Stars](https://base-sepolia.blockscout.com/address/0x70b089840FB3D567C5d618b222503d68A8ad0dAa#code)\n- Sourcify: [All Stars](https://sourcify.dev/server/repo-ui/84532/0x70b089840FB3D567C5d618b222503d68A8ad0dAa)\n\n---\n\n## For Contributors\n\n### Deploy\n\nFirstly, set the `.env` based on `.env.example`.\n\nThen deploy the smartcontracts:\n\n```shell\nnpx hardhat run ./scripts/deploy-all-stars.js --network [network_name]\n```\n\nThen verify the smartcontracts:\n\n```shell\nnpx hardhat verify --network [network_name] [deployed_contract_address]\n```\n\n### Generating ABIs\n\nTo regenerate the ABIs after contract changes:\n\n1. Add the addresses and network in `/wagmi.config.ts`\n2. Run `npm run wagmi` to re-generate the abi files\n3. The updated `./abis.ts` will be ready for publishing","readmeFilename":"README.md"}