{"id":18367715,"url":"https://github.com/rairprotocol/rair-solidity","last_synced_at":"2025-04-05T13:06:06.006Z","repository":{"id":100066823,"uuid":"580882453","full_name":"rairprotocol/rair-solidity","owner":"rairprotocol","description":"public repo for RAIR solidity code","archived":false,"fork":false,"pushed_at":"2025-02-19T01:04:03.000Z","size":4127,"stargazers_count":141,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T12:06:01.510Z","etag":null,"topics":["dapps-development","solidity","solidity-contracts"],"latest_commit_sha":null,"homepage":"https://rairprotocol.org","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rairprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2022-12-21T17:35:18.000Z","updated_at":"2025-02-23T14:30:32.000Z","dependencies_parsed_at":"2024-04-24T14:41:22.600Z","dependency_job_id":"0cf34f6d-fd22-47d0-9de9-302f706d39ea","html_url":"https://github.com/rairprotocol/rair-solidity","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.09999999999999998,"last_synced_commit":"c2360d044c95e47e40ffbf5975a13f7e39c868d2"},"previous_names":["rairprotocol/rairsolidity","rairprotocol/rair-solidity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rairprotocol%2Frair-solidity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rairprotocol%2Frair-solidity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rairprotocol%2Frair-solidity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rairprotocol%2Frair-solidity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rairprotocol","download_url":"https://codeload.github.com/rairprotocol/rair-solidity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"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":["dapps-development","solidity","solidity-contracts"],"created_at":"2024-11-05T23:23:05.480Z","updated_at":"2025-04-05T13:06:05.990Z","avatar_url":"https://github.com/rairprotocol.png","language":"Solidity","readme":"# RAIR Smart Contracts\nSource code and deployment scripts for RAIR smart contracts.\nNotice: classic-contracts are deprecated\n\n## Setup\nEnvironment variables  \n\n| Name | Description |\n| --- | --- | \n| ETH_MAIN_RPC | RPC endpoint for Ethereum Mainnet |\n| SEPOLIA_RPC | RPC endpoint for Ethereum Sepolia | \n| AMOY_RPC | RPC endpoint for Matic Amoy |\n| MATIC_RPC | RPC endpoint for Matic Mainnet |\n| BASE_RPC | RPC endpoint for Base Mainnet |\n| CORE_RPC | RPC endpoint for Core Mainnet |\n| ADDRESS_PRIVATE_KEY | Private key of the deployer wallet |\n| COINMARKETCAP_API_KEY | API Key from coinmarketcap for hardhat's gas price estimations (optional) |\n| ETHERSCAN_API_KEY | API key for Etherscan (used for verifying contracts) |\n| POLYGONSCAN_API_KEY | API key for Polygonscan (used for verifying contracts) |\n\n## Deploying\nInside the deploy directory you'll find the scripts for all of the diamond contract facets and the 5 main diamond contracts used by the RAIR system:  \n\n| Contract | Description |\n| --- | --- |\n| Factory | In charge of deploying the ERC721 diamonds |\n| Marketplace | Minting and resale offers |\n| Facet Source | Diamond contract from which all ERC721 contracts get their facets |\n| ERC20 | Normal contract for the RAIR token |\n| 721Exchange | Auxiliary contract to swap RAIR tokens with an NFT |\n\nThe deployment process is automated, it is done thanks to hardhat-deploy and the verification is done through hardhat-verify.  All deployed contracts can be found in the \"deployments\" directory\n\n## Testing\n```npm run test``` will start the local testing on an ethereum mainnet fork, the main test script is under the \"test\" directory\n\n## Setup\n### Connecting the facets\nOnce all diamond facets are verified you'll need to connect them with the diamondCut function\n* Necessary for all 3 contracts:\n    * DiamondCutFacet\n    * DiamondLoupeFacet\n    * OwnershipFacet\n* Addresses for Factory\n    * CreatorsFacet\n\t* DeployerFacet\n\t* TokensFacet\n    * PointsDeposit\n\t* PointsQuery\n\t* PointsWithdraw\n* Addresses for Marketplace\n    * MintingOffersFacet\n    * FeesFacet\n    * ResaleFacet\n* Addresses for the ERC721 source\n    * ERC721EnumerableFacet\n    * RAIRMetadataFacet\n    * RAIRProductFacet\n    * RAIRRangesFacet\n    * RAIRRoyaltiesFacet\n\n### Setup calls\n| Functions | Description |\n| --- | --- | \n| Factory.changeToken(ERC20 address, Price for deployment) | Configure the factory to use tokens from the ERC20 to deploy |\n| Factory.setFacetSource(Facet source address) | Connect the factory to the main hub of diamond facets |\n| Marketplace.updateTreasuryAddress(Treasury address) | Set the address for the treasury fees |\n| Marketplace.updateTreasuryFee(Value) | Percentage the treasury will receive on every mint  |\n| Marketplace.grantRole(RESALE_ADMIN, Signer address) | Approve an user address to generate resale hashes |","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frairprotocol%2Frair-solidity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frairprotocol%2Frair-solidity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frairprotocol%2Frair-solidity/lists"}