{"id":14971412,"url":"https://github.com/rechain-network-solutions/affinet","last_synced_at":"2026-01-23T07:07:53.065Z","repository":{"id":252375861,"uuid":"840256586","full_name":"REChain-Network-Solutions/AffiNet","owner":"REChain-Network-Solutions","description":"Incentivize users to complete on-chain actions, such as swap, mint, bridge, stake, or play. Tap into our plug-and-play incentive infrastructure and launch your smart-contract-based incentive program within 5 minutes, for free. Music to your ears? Affi Network is committed to driving innovation and decentralization in the on-chain marketing universe","archived":false,"fork":false,"pushed_at":"2024-08-09T10:00:05.000Z","size":680,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T18:49:57.068Z","etag":null,"topics":["affi","avalanche","base","network","polygon","solana"],"latest_commit_sha":null,"homepage":"https://testnet.affi.network/","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/REChain-Network-Solutions.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T09:55:37.000Z","updated_at":"2024-08-09T10:03:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"e5d0cf4c-12a7-49b9-99cc-7177c8aad392","html_url":"https://github.com/REChain-Network-Solutions/AffiNet","commit_stats":null,"previous_names":["rechain-network-solutions/affinet"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REChain-Network-Solutions%2FAffiNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REChain-Network-Solutions%2FAffiNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REChain-Network-Solutions%2FAffiNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REChain-Network-Solutions%2FAffiNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/REChain-Network-Solutions","download_url":"https://codeload.github.com/REChain-Network-Solutions/AffiNet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059523,"owners_count":22007771,"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":["affi","avalanche","base","network","polygon","solana"],"created_at":"2024-09-24T13:45:09.821Z","updated_at":"2026-01-23T07:07:53.054Z","avatar_url":"https://github.com/REChain-Network-Solutions.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Affi Network Core Contracts\n\n[![banner](./assets/banner.png)](https://affi.network)\n\n\nThis repo contains the very first version of the Affi Network Core contract. A step towards zero ad fraud, result-based affiliate marketing through blockchain medium. \n\n\n\n## Motivation \n\nAdvertisers have been fighting an uphill battle to hook up with publishers on a commission basis for decades. Publisher may exaggerate their traffic, and advertisers may not pay publishers on time. verifying the truth tedious task. Affi Network is a result-based affiliate marketing platform that uses blockchain to verify the truth and pay publishers on time. on top of it it rewawrd buyers with cashback.the smart contract is the core protocol between advertisers and publishers and buyers.\n\n## Design\n\nIt contains two main files ```CampaignFactory``` and ```CampaignContract```  the factory is deployed by protocol, and advertisers deploy campaign contracts.\n\nFactory allows creating a campaign backed by either more decentralized ``` DAI``` or less-decentralized stablecoins. On future versions of Affi networks, it is planned to support $AFFI as a commission payment. \n\n\nEach campaign contract deployed by the factory contains critical on-chain information about each campaign. \n\n\n- ***duration***: there is a hardcoded lock of `30` days to give enough time to the advertiser to react \n- ***contract address***: the target contract to be promised by publishers \n- ***network***: currently supports a large chunk of EVM chains \n- ***cost of acquisition***: the cost per sale \n- ***party shares***: how much cashback and commission are being paid \n\n\nWhenever a transaction happens on the target contract address, our automated bot will check for sanity and security checks and call ```sealADeal``` function to pay all parties. \n\n\n\nCore contracts follow a monolith architecture and use no inline assembly and surprises to make auditing more pleasant; even though various gas optimization like proper error reverting and data packing, use gas optimized/audited ERC-20 implementation, and the modern compiler used, the primary design goal was security and simplicity over-optimization. Core contract running primarily on the Polygon network, its relatively affordable to interact with the current contract. \n\n\n\n## Deployed Address : \n\n### Factory / Campaign mainnet : \n\n- [0x32058A926cb49237fC19717f2E307FE09A930287](https://polygonscan.com/address/0x32058a926cb49237fc19717f2e307fe09a930287)\n\n\n## Testing\n\n```shell\nforge test -vv\n```\n\nto get code coverage info this foundry add a way to filter specfic target use this.\n\n```\n forge coverage | egrep 'CampaignFactory.sol|CampaignContract.sol'\n```\n\ncurrent coverage is at 100%.\n\n## Stack\n\n- foundry\n- solmate\n\n## Security \n\n### Audit \n\n- Audit by [Beosin](./assets/Audit-2023-03-10.pdf)\n- Audit methods: Formal Verification, Static Analysis, Typical Case Testing \n- Audit hash = [54d798cbce572ecb6568432c95b2a0a8a33a93fc](https://github.com/AffiNetwork/core-v1/commit/54d798cbce572ecb6568432c95b2a0a8a33a93fc)\n\n### Automated security testing\n\n- Slither (static)\n\n```shell\n\n slither . --config-file slither.config.json\n```\n\n- Mythril (dynamic)\n\n```shell\ndocker run --rm -v ${PWD}:/code mythril/myth:latest a /code/src/CampaignFactory.sol --solc-json  /code/mythril.config.json\n```\n\n\n## Deployment\n\n```\n\nforge script script/CampaignFactory.s.sol:DeployFactory --rpc-url http://127.0.0.1:8545 --broadcast --sender 0xdeployer --private-key 0xkey\n```\n\n### Verification\n\n```\n\n forge script script/CampaignFactory.s.sol:DeployFactory --private-key 0xkey  \\\n    --etherscan-api-key polygonscan_key \\\n    --verify\n```\n\n### checking deployed contract \n\n```\n cast call  0xfactory  \"campaigns(uint256)(address)\" 0  --rpc-url http://127.0.0.1:8545 --from 0xdeployer --private-key 0xkey\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frechain-network-solutions%2Faffinet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frechain-network-solutions%2Faffinet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frechain-network-solutions%2Faffinet/lists"}