{"id":25322409,"url":"https://github.com/checkernetwork/meridian-impact-evaluator","last_synced_at":"2025-10-29T01:31:19.613Z","repository":{"id":187861305,"uuid":"677708722","full_name":"CheckerNetwork/meridian-impact-evaluator","owner":"CheckerNetwork","description":"Impact Evaluator smart contract","archived":false,"fork":false,"pushed_at":"2025-01-29T11:00:22.000Z","size":619,"stargazers_count":4,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T12:36:28.485Z","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/CheckerNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-08-12T11:22:03.000Z","updated_at":"2025-01-29T10:58:56.000Z","dependencies_parsed_at":"2023-08-12T12:33:36.175Z","dependency_job_id":"850189f6-c5bf-4ac9-9719-b8580e6b0177","html_url":"https://github.com/CheckerNetwork/meridian-impact-evaluator","commit_stats":null,"previous_names":["meridian-ie/impact-evaluator","checkernetwork/meridian-impact-evaluator"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheckerNetwork%2Fmeridian-impact-evaluator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheckerNetwork%2Fmeridian-impact-evaluator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheckerNetwork%2Fmeridian-impact-evaluator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheckerNetwork%2Fmeridian-impact-evaluator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CheckerNetwork","download_url":"https://codeload.github.com/CheckerNetwork/meridian-impact-evaluator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238754216,"owners_count":19524904,"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-02-13T23:40:43.447Z","updated_at":"2025-10-29T01:31:14.298Z","avatar_url":"https://github.com/CheckerNetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# impact-evaluator\n\n[Meridian Impact Evaluator](https://pl-strflt.notion.site/Meridian-Design-Doc-06-Decentralization-78c1158223df45a4bec4f162e0fcfc3d?pvs=4)\n\n[Impact Evaluator Framework](https://pl-strflt.notion.site/Impact-Evaluator-Framework-8addafa892674a0d8e67440f309c742f)\n\n## Public functions\n\n### `.addMeasurements(string cid) -\u003e uint`\n\n### `.tick()`\n\n### `.rewardsScheduledFor(address participant) -\u003e uint`\n\n### `.availableBalance() -\u003e uint`\n\n### `.participantCountReadyForTransfer() -\u003e uint`\n\n### `.participantCountScheduledForTransfer() -\u003e uint`\n\n## Evaluator functions\n\n### `.setScores(uint roundIndex, address payable[] addresses, uint[] scores)`\n\nOnce a round's scores sum up to `MAX_SCORE = 1e15`, the `reward()` function\nwill be called and the round finishes.\n\n## Admin functions\n\n### `.adminAdvanceRound()`\n\n### `.setNextRoundLength(uint nextRoundLength)`\n\n### `.setRoundReward(uint roundReward)`\n\n### `.setMaxTransfersPerTx(uint max)`\n\n### `setMinBalanceForTransfer(uint min)`\n\n### `addBalances(address[] addresses, uint[] balances)`\n\n### `.releaseRewards()`\n\n### `.withdraw()`\n\n### `.disableWithdraw()`\n\n## Getters / Views\n\n### `.currentRoundIndex() -\u003e uint`\n\n### `.nextRoundLength() -\u003e uint`\n\n### `.roundReward() -\u003e uint`\n\n### `.balanceOf(address account) view -\u003e uint`\n\n### `.participantIsReadyForTransfer(address account) view -\u003e bool`\n\n## Roles\n\n### `.EVALUATE_ROLE()`\n\n## Events\n\n### `MeasurementsAdded(string cid, uint indexed roundIndex, address indexed sender)`\n\n### `RoundStart(uint roundIndex)`\n\n### `Transfer(address indexed to, uint amount)`\n\n### `TransferFailed(address indexed to, uint amount)`\n\n## Development\n\nThis repo requires Rust and Cargo, which can be installed from\n[here](https://doc.rust-lang.org/book/ch01-01-installation.html)\n\n##### Install Foundry\n\nWe recommend you install it from source:\n\n```bash\ngit clone https://github.com/foundry-rs/foundry\ncd foundry\ngit checkout 9a4bb7f5\n# install cast + forge\ncargo install --path ./cli --profile local --bins --locked --force\n# install anvil\ncargo install --path ./anvil --profile local --locked --force\n```\n\n##### Clone Repo and Install\n\n```bash\ngit clone https://github.com/meridian-ie/impact-evaluator.git\ncd impact-evaluator\ngit submodule update --init --recursive\nforge test\n```\n\n##### Local Development\n\nTo iterate quickly, the `anvil` network can be used to develop locally. Note\nthat Anvil strictly uses Etheruem addressing and does not include Filecoin\npre-compiles.\n\nFirst run `anvil`:\n\n```bash\nanvil\n```\n\nThe output will provide a list of private keys and addresses that can be used.\nAnvil's default mnemonic is:\n`test test test test test test test test test test test junk`\n\nTo deploy the contract on Anvil, run:\n\n```bash\nforge create --rpc-url http://127.0.0.1:8545 --mnemonic \"test test test test test test test test test test test junk\" src/ImpactEvaluator.sol:ImpactEvaluator --constructor-args 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\n```\n\n## Deployment\n\nContracts can be deployed using the `forge cli` or using a rust deployment\nscript that leverages contract bindings.\n\n### Forge CLI\n\nThis deployment method requires manual insertion of a private key and is not\nrecommended for production use cases.\n\nNOTE: Deployment using forge CLI often errors out on Filecoin networks even\nthough the transaction goes through (Foundry is configured for EVM's block time,\nnot FVM's). Use a block explorer to find the address of the contract.\n\nMake sure the following env vars are defined as follows:\n\n```bash\nexport RPC_URL=\"...\"\nexport ADMIN_ADDRESS=\"...\"\nexport MNEMONIC_PATH=\"{path to mnemonic secret file}\"\n```\n\nTo deploy using a private key, run:\n\n```bash\nforge create --rpc-url $RPC_URL --private-key \u003cyour_private_key\u003e src/ImpactEvaluator.sol:ImpactEvaluator --constructor-args $ADMIN_ADDRESS\n```\n\nTo deploy using a local mnemonic secret, run:\n\n```bash\nforge create --rpc-url $RPC_URL --mnemonic $MNEMONIC_PATH src/ImpactEvaluator.sol:ImpactEvaluator --constructor-args $ADMIN_ADDRESS\n```\n\n### Deployment Rust Script\n\nThe deployment relies on contract bindings generated in the `/contract-bindings`\ndirectory. If you make changes to the contracts, run:\n\n```bash\nrm -rf contract-bindings\nforge bind  --crate-name contract-bindings -b ./contract-bindings\n```\n\nThis will create new bindings with the modified contracts.\n\nDeployment can then proceed either with a locally stored mnemonic or a connected\nethereum ledger wallet. To use with a mnemonic, create a `secrets/mnemonic` file\nin the root directory.\n\nTo deploy, run:\n\n```bash\n(cd contract-utils \u0026\u0026 cargo run)\n```\n\n## Tests\n\n#### Integration Tests\n\nIntegration tests run on the filecoin calibration net and require a wallet with\ntest FIL to pay for gas fees on the calibration net. Test FIL is free and can be\nobtained using the [faucet](https://faucet.calibration.fildev.network/).\n\nBefore running integration tests, these env vars are required:\n\n```bash\nexport TEST_RPC_URL=https://api.calibration.node.glif.io/rpc/v1\nexport TEST_MNEMONIC={insert wallet mnemonic here}\nexport TEST_CONTRACT_ADDRESS={this can be an empty string}\n```\n\nTo run tests, run:\n\n```bash\ncd contract-utils\ncargo test  -- --nocapture --test-threads 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckernetwork%2Fmeridian-impact-evaluator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckernetwork%2Fmeridian-impact-evaluator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckernetwork%2Fmeridian-impact-evaluator/lists"}