{"id":49856928,"url":"https://github.com/jgresham/mental-poker-contracts","last_synced_at":"2026-05-14T20:17:09.722Z","repository":{"id":283555158,"uuid":"951649659","full_name":"jgresham/mental-poker-contracts","owner":"jgresham","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-22T01:09:33.000Z","size":1769,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-29T02:41:05.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jgresham.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,"zenodo":null}},"created_at":"2025-03-20T02:49:42.000Z","updated_at":"2025-05-19T18:27:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"b07b0f02-9248-46c7-9879-3ede3aece979","html_url":"https://github.com/jgresham/mental-poker-contracts","commit_stats":null,"previous_names":["jgresham/mental-poker-contracts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jgresham/mental-poker-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgresham%2Fmental-poker-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgresham%2Fmental-poker-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgresham%2Fmental-poker-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgresham%2Fmental-poker-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgresham","download_url":"https://codeload.github.com/jgresham/mental-poker-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgresham%2Fmental-poker-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33041547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-05-14T20:17:09.123Z","updated_at":"2026-05-14T20:17:09.716Z","avatar_url":"https://github.com/jgresham.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mental Poker\n\n**Mental Poker is a cryptographic protocol that allows players to play a fair card game without the need for a trusted third party.**\n\nMental Poker enables:\n\n- **Secure Card Shuffling**: Players can collectively shuffle a deck of cards without any single player knowing the order.\n- **Card Dealing**: Cards can be dealt to players without revealing them to others.\n- **Card Revelation**: Players can reveal their cards to prove their hand at the end of the game.\n- **Cheating Prevention**: The protocol prevents players from cheating by marking cards or stacking the deck.\n\nThis implementation uses ElGamal encryption and other cryptographic primitives to enable secure, trustless card games on the Ethereum blockchain.\n\n## How It Works\n\nMental Poker uses advanced cryptographic techniques like **Commutative Encryption** which allows multiple parties to encrypt and decrypt cards in any order\n\n## Foundry\n\n**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**\n\nFoundry consists of:\n\n-   **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).\n-   **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.\n-   **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.\n-   **Chisel**: Fast, utilitarian, and verbose solidity REPL.\n\n## Documentation\n\nhttps://book.getfoundry.sh/\n\n## Usage\n\n### Build\n\n```shell\n$ forge build\n# to get the contract byte sizes (evm limitation at 25KB currently, soon 256KB), run\n$ forge build --sizes\n```\n\n### Test\n\n```shell\n$ forge test\n```\n\n### Format\n\n```shell\n$ forge fmt\n```\n\n### Gas Snapshots\n\n```shell\n$ forge snapshot\n```\n\n### Anvil\n\n```shell\n$ anvil\n```\n\n### Deploy\n\n#### Local\n```shell\nanvil --block-time 2 --port 8545\n# chainId = 31337\n# Deploy to a local anvil network\nforge script script/DeployAll.s.sol:DeployAll --rpc-url http://127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast\n\n# Base Sepolia\nforge script script/DeployProd.s.sol:DeployProd --rpc-url https://sepolia.base.org --private-key $PRIVATE_KEY --chain base-sepolia --verifier-url https://api-sepolia.basescan.org/api --broadcast --verify\n\n# Base\nforge script script/DeployProd.s.sol:DeployProd --rpc-url https://mainnet.base.org --private-key $PRIVATE_KEY --chain base --verifier-url https://api.basescan.org/api --broadcast --verify\n\n# Optimism\nforge script script/DeployProd.s.sol:DeployProd --rpc-url https://mainnet.optimism.io --private-key $PRIVATE_KEY --chain optimism --verifier-url https://api-optimistic.etherscan.io/api --broadcast --verify --verifier-api-key $OP_ETHERSCAN_API_KEY\n\n# Arbitrum\nforge script script/DeployProd.s.sol:DeployProd --rpc-url https://arb1.arbitrum.io/rpc --private-key $PRIVATE_KEY --chain arbitrum --verifier-url https://api.arbiscan.io/api --broadcast --verify --verifier-api-key $ARBISCAN_API_KEY\n\n```\n\n## Verify if it fails after deploy\n\n```shell\nforge verify-contract \u003cdeployed-contract-address\u003e src/TexasHoldemRoom.sol:TexasHoldemRoom --chain base-sepolia --etherscan-api-key $ETHERSCAN_API_KEY --verifier-url https://sepolia.base.org --watch\n\nforge verify-contract 0xBABEc5F06672aB06113BEC7532397bEb6a1702bc src/TexasHoldemRoom.sol:TexasHoldemRoom --chain base-sepolia --etherscan-api-key $ETHERSCAN_API_KEY --verifier-url https://api-sepolia.basescan.org/api --watch\n\nforge verify-contract 0xF2635f00300F16D9acA57F955091Cc24DD01F7d1 src/BigNumbers/BigNumbers.sol:BigNumbers --chain base-sepolia --etherscan-api-key $ETHERSCAN_API_KEY --verifier-url https://api-sepolia.basescan.org/api --watch --flatten\n```\n\n### Cast\n\n```shell\n$ cast \u003csubcommand\u003e\n```\n\n### Help\n\n```shell\n$ forge --help\n$ anvil --help\n$ cast --help\n```\n\n\n## Deploys\nMon, Apr 28th 2025\n```\n== Logs ==\n  Contract TexasHoldemRoom deployed at: 0xf34890f942220f48391BA33Ff053f64Aa8979956\n  Contract DeckHandler deployed at: 0x8ad3D9cf837117d44Ec08e77a3C38420f92243E9\n\n## Setting up 1 EVM.\n\n==========================\n\nChain 8453\n\nEstimated gas price: 0.007277138 gwei\n\nEstimated total gas used for script: 27820265\n\nEstimated amount required: 0.00020245190760157 ETH\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgresham%2Fmental-poker-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgresham%2Fmental-poker-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgresham%2Fmental-poker-contracts/lists"}