{"id":29795468,"url":"https://github.com/ubisoft/authenticated-relay","last_synced_at":"2025-07-28T04:11:10.123Z","repository":{"id":287057357,"uuid":"854712623","full_name":"ubisoft/authenticated-relay","owner":"ubisoft","description":"Solidity smart contract that verifies an authorization signature before forwarding the call to the destination contract. Can be used for backend-gated minting.","archived":false,"fork":false,"pushed_at":"2024-09-09T16:44:58.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T19:21:55.579Z","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/ubisoft.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":"2024-09-09T16:44:04.000Z","updated_at":"2024-09-10T08:02:15.000Z","dependencies_parsed_at":"2025-04-09T19:21:58.168Z","dependency_job_id":"778cb3fb-ef70-4233-8dba-1e9e14fe45d9","html_url":"https://github.com/ubisoft/authenticated-relay","commit_stats":null,"previous_names":["ubisoft/authenticated-relay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ubisoft/authenticated-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubisoft%2Fauthenticated-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubisoft%2Fauthenticated-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubisoft%2Fauthenticated-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubisoft%2Fauthenticated-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ubisoft","download_url":"https://codeload.github.com/ubisoft/authenticated-relay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ubisoft%2Fauthenticated-relay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267459946,"owners_count":24090787,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"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":"2025-07-28T04:11:06.463Z","updated_at":"2025-07-28T04:11:10.112Z","avatar_url":"https://github.com/ubisoft.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authenticated relay\n\nSolidity smart contract that verifies an authorisation signature before forwarding the call to the destination contract. Can be used for backend-gated minting.\n\n## Overview\n\nThe relay is deployed on-chain and is configured with an `operator` role (`OPERATOR_ROLE`)\nThe backend signs an EIP-712 message of the following structure with an owner key:\n\n```solidity\nstruct RelayData {\n    bytes32 nonce;\n    address to;\n    uint256 validityStart;\n    uint256 validityEnd;\n    uint256 chainId;\n    bytes callData;\n}\n```\n\nWhere `to` is the destination contract, `callData` is the ABI-encoded calldata. The relay verifies that the recovered signature matches an owner role and executes the call on the destination contract.\n\nThe `operator` address can be updated by the `admin` (`DEFAULT_ADMIN_ROLE`)\n\n## Usage\n\nThis example uses a test agains [Sequence's ERC721 contract library](https://github.com/0xsequence/contracts-library/blob/master/src/tokens/ERC721/presets/items/ERC721Items.sol).\nSee `test/AuthenticatedRelay.t.sol` for details.\n\n### Requirements\n- Foundry: https://book.getfoundry.sh/\n\n### Build\n```shell\nforge install\n# build sequence contracts dependencies:\npushd lib/contracts-library\nyarn \u0026\u0026 yarn build\npopd\n\nforge build\n```\n\n### Test\n```shell\nforge test\n```\n\n### Example: mint an ERC721\nSet the environment variables:\n- `RELAY_CONTRACT`: The authenticated relay address\n- `OPERATOR_PRIVATE_KEY`: The operator private key\n- `ERC721_CONTRACT`: The ERC721 contract address. It has a `mint(address,uint256)` function that can only be called by the authenticated relay\n- `RECIPIENT`: The NFT recipient\n- `SENDER_PRIVATE_KEY`: The key of the wallet that will broadcast the transaction\n- `NONCE`: A nonce to prevent replays\n\nThen run the script:\n```bash\nforge script script/MinterWithRelay.s.sol:MintWithRelay --broadcast --private-key $SENDER_PRIVATE_KEY\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubisoft%2Fauthenticated-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fubisoft%2Fauthenticated-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fubisoft%2Fauthenticated-relay/lists"}