{"id":15456942,"url":"https://github.com/expede/validated-token","last_synced_at":"2025-03-28T10:15:49.140Z","repository":{"id":87678098,"uuid":"153966579","full_name":"expede/validated-token","owner":"expede","description":"ERC902 implementation","archived":false,"fork":false,"pushed_at":"2018-10-21T04:03:52.000Z","size":821,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T10:43:13.166Z","etag":null,"topics":["erc1066","erc20","erc902"],"latest_commit_sha":null,"homepage":"https://eips.ethereum.org/EIPS/eip-902","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/expede.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-10-21T02:29:57.000Z","updated_at":"2020-04-09T03:45:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7588ea37-4d3c-4a4b-b6cc-3816328e11ec","html_url":"https://github.com/expede/validated-token","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expede%2Fvalidated-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expede%2Fvalidated-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expede%2Fvalidated-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expede%2Fvalidated-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expede","download_url":"https://codeload.github.com/expede/validated-token/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246009178,"owners_count":20708907,"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":["erc1066","erc20","erc902"],"created_at":"2024-10-01T22:40:58.632Z","updated_at":"2025-03-28T10:15:49.114Z","avatar_url":"https://github.com/expede.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validated Token Example Contracts\r\n\r\n[![Build Status](https://travis-ci.org/expede/validated-token.svg?branch=master)](https://travis-ci.org/expede/validated-token)\r\n[![Maintainability](https://api.codeclimate.com/v1/badges/ed1d4e37934c28c0fa5a/maintainability)](https://codeclimate.com/github/expede/validated-token/maintainability)\r\n![ERC Status](https://img.shields.io/badge/erc_status-DRAFT-lightrey.svg)\r\n[![ERC902](https://img.shields.io/badge/ERC-902-386.svg)](https://eips.ethereum.org/EIPS/eip-902)\r\n[![ERC1066](https://img.shields.io/badge/ERC-1066-42A.svg)](https://eips.ethereum.org/EIPS/eip-1066)\r\n\r\n## Architecture\r\n\r\nThe basic relationship of this protocol is very simple: there are validators that expose two `check` functions:\r\n\r\n```solidity\r\ncheck(address token, address user) returns (byte status)\r\ncheck(address token, address to, address from, uint256 amout) returns (byte status)\r\n```\r\n\r\nWhy list this as a `Caller` and not `Token`? Because validators may be arranged into a DAG of validation dependencies. They may check `any` and `all` of their dependencies, or have more complex logic, change which dependencies are required based on who they're validating, and so on.\r\n\r\n# Interface\r\n\r\n```solidity\r\ninterface TokenValidator {\r\n    function check(\r\n        address _token,\r\n        address _subject\r\n    ) public returns(byte statusCode)\r\n\r\n    function check(\r\n        address _token,\r\n        address _from,\r\n        address _to,\r\n        uint256 _amount\r\n    ) public returns (byte statusCode)\r\n}\r\n```\r\n\r\n# Architecture\r\n\r\n## Isolated\r\n\r\n```\r\n        +--------+\r\n        │ Caller |\r\n        +--------+\r\n           │  ↑\r\ncheck(...) │  │ statusCode\r\n           ↓  │\r\n      +-----------+\r\n      | Validator |\r\n      +-----------+\r\n```\r\n\r\nHere `Caller` may be a token, another `Validator`, an exchange (directly checking), or a user verifying that they will be authorized to perform some action.\r\n\r\n## Stacked\r\n\r\n(With example ERC1066 status codes for flavour)\r\n\r\n```\r\n        +-------+\r\n        │ Token |\r\n        +-------+\r\n           │  ↑\r\ncheck(...) │  │ 0x11\r\n           ↓  │          check(...)\r\n      +------------+   -------------\u003e   +------------+\r\n      | ValidatorA |                    | ValidatorC |\r\n      +------------+   \u003c-------------   +------------+\r\n           │  ↑             0x21             │  ↑\r\ncheck(...) │  │ 0x11              check(...) │  │ 0x31\r\n           ↓  │                              ↓  │\r\n      +------------+                    +------------+\r\n      | ValidatorB |                    | ValidatorD |\r\n      +------------+                    +------------+\r\n```\r\n\r\n# Example Diagram\r\n\r\nA somewhat contrived example is for purchasing a holiday via the blockchain. Here, we have `TravelToken`, which is your travel package (flight \u0026 hotel details, \u0026c). In order to purchase such a token, you need to be able to have a valid travel visa, have all of your immunizations up to date, and prove that you are who you say you are. In turn, the travel visa requires that you're not a crminal on a government watch list.\r\n\r\nEach of these validation services may be operated variously by the travel agency, governments, and identity services. By implementing the `TokenValidator` interface, these validation services can interact with other validators to check information that they don't own.\r\n\r\n![](https://raw.githubusercontent.com/expede/validated-token/master/assets/diagram.png?token=ABANcIE7drQhztiQvBrtwOeLgKnXAWifks5aljr9wA%3D%3D)\r\n\r\n## Links\r\n\r\n* [EIP](https://eips.ethereum.org/EIPS/eip-902)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpede%2Fvalidated-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpede%2Fvalidated-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpede%2Fvalidated-token/lists"}