From e979de2b289e09ce8d9027662ab7c6ec2b3f349d Mon Sep 17 00:00:00 2001 From: Jiacheng Xu Date: Fri, 10 Nov 2023 01:08:39 +0800 Subject: [PATCH] chore: rename token security benchmark to token risk classification (#4) --- .github/pull_request_template.md | 2 +- CONTRIBUTING.md | 16 +++++----- README.md | 6 ++-- docs/TRC-001.md | 13 ++++++++ docs/TRC-002.md | 20 +++++++++++++ docs/TRC-003.md | 26 ++++++++++++++++ docs/TRC-004.md | 21 +++++++++++++ docs/TRC-005.md | 20 +++++++++++++ docs/TRC-006.md | 20 +++++++++++++ docs/TRC-007.md | 25 ++++++++++++++++ docs/{TSB-008.md => TRC-008.md} | 10 +++---- docs/{TSB-009.md => TRC-009.md} | 10 +++---- docs/{TSB-010.md => TRC-010.md} | 10 +++---- docs/{TSB-011.md => TRC-011.md} | 10 +++---- docs/{TSB-012.md => TRC-012.md} | 10 +++---- docs/{TSB-013.md => TRC-013.md} | 10 +++---- docs/{TSB-014.md => TRC-014.md} | 10 +++---- docs/{TSB-015.md => TRC-015.md} | 10 +++---- docs/{TSB-016.md => TRC-016.md} | 10 +++---- docs/TSB-001.md | 13 -------- docs/TSB-002.md | 20 ------------- docs/TSB-003.md | 26 ---------------- docs/TSB-004.md | 21 ------------- docs/TSB-005.md | 20 ------------- docs/TSB-006.md | 20 ------------- docs/TSB-007.md | 25 ---------------- docs/contributing.md | 16 +++++----- docs/index.md | 6 ++-- go.mod | 2 +- hack/gendocs/main.go | 6 ++-- mkdocs.yml | 40 ++++++++++++------------- src/{TSB-001 => TRC-001}/metadata.json | 2 +- src/{TSB-001 => TRC-001}/samples/01.sol | 0 src/{TSB-001 => TRC-001}/samples/02.sol | 0 src/{TSB-001 => TRC-001}/samples/03.sol | 0 src/{TSB-001 => TRC-001}/samples/04.sol | 0 src/{TSB-001 => TRC-001}/samples/05.sol | 0 src/{TSB-002 => TRC-002}/metadata.json | 2 +- src/{TSB-002 => TRC-002}/pattern.sol | 0 src/{TSB-002 => TRC-002}/samples/01.sol | 0 src/{TSB-002 => TRC-002}/samples/02.sol | 0 src/{TSB-002 => TRC-002}/samples/03.sol | 0 src/{TSB-002 => TRC-002}/samples/04.sol | 0 src/{TSB-003 => TRC-003}/metadata.json | 2 +- src/{TSB-003 => TRC-003}/pattern.sol | 0 src/{TSB-003 => TRC-003}/samples/01.sol | 0 src/{TSB-003 => TRC-003}/samples/02.sol | 0 src/{TSB-003 => TRC-003}/samples/03.sol | 0 src/{TSB-003 => TRC-003}/samples/04.sol | 0 src/{TSB-004 => TRC-004}/metadata.json | 2 +- src/{TSB-004 => TRC-004}/pattern.sol | 0 src/{TSB-004 => TRC-004}/samples/01.sol | 0 src/{TSB-004 => TRC-004}/samples/02.sol | 0 src/{TSB-004 => TRC-004}/samples/03.sol | 0 src/{TSB-004 => TRC-004}/samples/04.sol | 0 src/{TSB-005 => TRC-005}/metadata.json | 2 +- src/{TSB-005 => TRC-005}/pattern.sol | 0 src/{TSB-005 => TRC-005}/samples/01.sol | 0 src/{TSB-005 => TRC-005}/samples/02.sol | 0 src/{TSB-005 => TRC-005}/samples/03.sol | 0 src/{TSB-005 => TRC-005}/samples/04.sol | 0 src/{TSB-006 => TRC-006}/metadata.json | 2 +- src/{TSB-006 => TRC-006}/pattern.sol | 0 src/{TSB-006 => TRC-006}/samples/01.sol | 0 src/{TSB-006 => TRC-006}/samples/02.sol | 0 src/{TSB-006 => TRC-006}/samples/03.sol | 0 src/{TSB-006 => TRC-006}/samples/04.sol | 0 src/{TSB-007 => TRC-007}/metadata.json | 2 +- src/{TSB-007 => TRC-007}/pattern.sol | 0 src/{TSB-007 => TRC-007}/samples/01.sol | 0 src/{TSB-007 => TRC-007}/samples/02.sol | 0 src/{TSB-007 => TRC-007}/samples/03.sol | 0 src/{TSB-007 => TRC-007}/samples/04.sol | 0 src/{TSB-008 => TRC-008}/metadata.json | 2 +- src/{TSB-008 => TRC-008}/pattern.sol | 0 src/{TSB-008 => TRC-008}/samples/01.sol | 0 src/{TSB-008 => TRC-008}/samples/02.sol | 0 src/{TSB-008 => TRC-008}/samples/03.sol | 0 src/{TSB-008 => TRC-008}/samples/04.sol | 0 src/{TSB-009 => TRC-009}/metadata.json | 2 +- src/{TSB-009 => TRC-009}/pattern.sol | 0 src/{TSB-009 => TRC-009}/samples/01.sol | 0 src/{TSB-009 => TRC-009}/samples/02.sol | 0 src/{TSB-009 => TRC-009}/samples/03.sol | 0 src/{TSB-009 => TRC-009}/samples/04.sol | 0 src/{TSB-010 => TRC-010}/metadata.json | 2 +- src/{TSB-010 => TRC-010}/pattern.sol | 0 src/{TSB-010 => TRC-010}/samples/01.sol | 0 src/{TSB-010 => TRC-010}/samples/02.sol | 0 src/{TSB-010 => TRC-010}/samples/03.sol | 0 src/{TSB-010 => TRC-010}/samples/04.sol | 0 src/{TSB-011 => TRC-011}/metadata.json | 2 +- src/{TSB-011 => TRC-011}/pattern.sol | 0 src/{TSB-011 => TRC-011}/samples/01.sol | 0 src/{TSB-011 => TRC-011}/samples/02.sol | 0 src/{TSB-011 => TRC-011}/samples/03.sol | 0 src/{TSB-011 => TRC-011}/samples/04.sol | 0 src/{TSB-012 => TRC-012}/metadata.json | 2 +- src/{TSB-012 => TRC-012}/pattern.sol | 0 src/{TSB-012 => TRC-012}/samples/01.sol | 0 src/{TSB-012 => TRC-012}/samples/02.sol | 0 src/{TSB-012 => TRC-012}/samples/03.sol | 0 src/{TSB-012 => TRC-012}/samples/04.sol | 0 src/{TSB-013 => TRC-013}/metadata.json | 2 +- src/{TSB-013 => TRC-013}/pattern.sol | 0 src/{TSB-013 => TRC-013}/samples/01.sol | 0 src/{TSB-013 => TRC-013}/samples/02.sol | 0 src/{TSB-013 => TRC-013}/samples/03.sol | 0 src/{TSB-013 => TRC-013}/samples/04.sol | 0 src/{TSB-014 => TRC-014}/metadata.json | 2 +- src/{TSB-014 => TRC-014}/pattern.sol | 0 src/{TSB-014 => TRC-014}/samples/01.sol | 0 src/{TSB-014 => TRC-014}/samples/02.sol | 0 src/{TSB-014 => TRC-014}/samples/03.sol | 0 src/{TSB-014 => TRC-014}/samples/04.sol | 0 src/{TSB-015 => TRC-015}/metadata.json | 2 +- src/{TSB-015 => TRC-015}/pattern.sol | 0 src/{TSB-015 => TRC-015}/samples/01.sol | 0 src/{TSB-015 => TRC-015}/samples/02.sol | 0 src/{TSB-015 => TRC-015}/samples/03.sol | 0 src/{TSB-015 => TRC-015}/samples/04.sol | 0 src/{TSB-016 => TRC-016}/metadata.json | 2 +- src/{TSB-016 => TRC-016}/pattern.sol | 0 src/{TSB-016 => TRC-016}/samples/01.sol | 0 src/{TSB-016 => TRC-016}/samples/02.sol | 0 src/{TSB-016 => TRC-016}/samples/03.sol | 0 src/{TSB-016 => TRC-016}/samples/04.sol | 0 127 files changed, 253 insertions(+), 253 deletions(-) create mode 100644 docs/TRC-001.md create mode 100644 docs/TRC-002.md create mode 100644 docs/TRC-003.md create mode 100644 docs/TRC-004.md create mode 100644 docs/TRC-005.md create mode 100644 docs/TRC-006.md create mode 100644 docs/TRC-007.md rename docs/{TSB-008.md => TRC-008.md} (51%) rename docs/{TSB-009.md => TRC-009.md} (53%) rename docs/{TSB-010.md => TRC-010.md} (52%) rename docs/{TSB-011.md => TRC-011.md} (55%) rename docs/{TSB-012.md => TRC-012.md} (56%) rename docs/{TSB-013.md => TRC-013.md} (54%) rename docs/{TSB-014.md => TRC-014.md} (51%) rename docs/{TSB-015.md => TRC-015.md} (54%) rename docs/{TSB-016.md => TRC-016.md} (55%) delete mode 100644 docs/TSB-001.md delete mode 100644 docs/TSB-002.md delete mode 100644 docs/TSB-003.md delete mode 100644 docs/TSB-004.md delete mode 100644 docs/TSB-005.md delete mode 100644 docs/TSB-006.md delete mode 100644 docs/TSB-007.md rename src/{TSB-001 => TRC-001}/metadata.json (95%) rename src/{TSB-001 => TRC-001}/samples/01.sol (100%) rename src/{TSB-001 => TRC-001}/samples/02.sol (100%) rename src/{TSB-001 => TRC-001}/samples/03.sol (100%) rename src/{TSB-001 => TRC-001}/samples/04.sol (100%) rename src/{TSB-001 => TRC-001}/samples/05.sol (100%) rename src/{TSB-002 => TRC-002}/metadata.json (93%) rename src/{TSB-002 => TRC-002}/pattern.sol (100%) rename src/{TSB-002 => TRC-002}/samples/01.sol (100%) rename src/{TSB-002 => TRC-002}/samples/02.sol (100%) rename src/{TSB-002 => TRC-002}/samples/03.sol (100%) rename src/{TSB-002 => TRC-002}/samples/04.sol (100%) rename src/{TSB-003 => TRC-003}/metadata.json (94%) rename src/{TSB-003 => TRC-003}/pattern.sol (100%) rename src/{TSB-003 => TRC-003}/samples/01.sol (100%) rename src/{TSB-003 => TRC-003}/samples/02.sol (100%) rename src/{TSB-003 => TRC-003}/samples/03.sol (100%) rename src/{TSB-003 => TRC-003}/samples/04.sol (100%) rename src/{TSB-004 => TRC-004}/metadata.json (94%) rename src/{TSB-004 => TRC-004}/pattern.sol (100%) rename src/{TSB-004 => TRC-004}/samples/01.sol (100%) rename src/{TSB-004 => TRC-004}/samples/02.sol (100%) rename src/{TSB-004 => TRC-004}/samples/03.sol (100%) rename src/{TSB-004 => TRC-004}/samples/04.sol (100%) rename src/{TSB-005 => TRC-005}/metadata.json (94%) rename src/{TSB-005 => TRC-005}/pattern.sol (100%) rename src/{TSB-005 => TRC-005}/samples/01.sol (100%) rename src/{TSB-005 => TRC-005}/samples/02.sol (100%) rename src/{TSB-005 => TRC-005}/samples/03.sol (100%) rename src/{TSB-005 => TRC-005}/samples/04.sol (100%) rename src/{TSB-006 => TRC-006}/metadata.json (94%) rename src/{TSB-006 => TRC-006}/pattern.sol (100%) rename src/{TSB-006 => TRC-006}/samples/01.sol (100%) rename src/{TSB-006 => TRC-006}/samples/02.sol (100%) rename src/{TSB-006 => TRC-006}/samples/03.sol (100%) rename src/{TSB-006 => TRC-006}/samples/04.sol (100%) rename src/{TSB-007 => TRC-007}/metadata.json (94%) rename src/{TSB-007 => TRC-007}/pattern.sol (100%) rename src/{TSB-007 => TRC-007}/samples/01.sol (100%) rename src/{TSB-007 => TRC-007}/samples/02.sol (100%) rename src/{TSB-007 => TRC-007}/samples/03.sol (100%) rename src/{TSB-007 => TRC-007}/samples/04.sol (100%) rename src/{TSB-008 => TRC-008}/metadata.json (94%) rename src/{TSB-008 => TRC-008}/pattern.sol (100%) rename src/{TSB-008 => TRC-008}/samples/01.sol (100%) rename src/{TSB-008 => TRC-008}/samples/02.sol (100%) rename src/{TSB-008 => TRC-008}/samples/03.sol (100%) rename src/{TSB-008 => TRC-008}/samples/04.sol (100%) rename src/{TSB-009 => TRC-009}/metadata.json (95%) rename src/{TSB-009 => TRC-009}/pattern.sol (100%) rename src/{TSB-009 => TRC-009}/samples/01.sol (100%) rename src/{TSB-009 => TRC-009}/samples/02.sol (100%) rename src/{TSB-009 => TRC-009}/samples/03.sol (100%) rename src/{TSB-009 => TRC-009}/samples/04.sol (100%) rename src/{TSB-010 => TRC-010}/metadata.json (93%) rename src/{TSB-010 => TRC-010}/pattern.sol (100%) rename src/{TSB-010 => TRC-010}/samples/01.sol (100%) rename src/{TSB-010 => TRC-010}/samples/02.sol (100%) rename src/{TSB-010 => TRC-010}/samples/03.sol (100%) rename src/{TSB-010 => TRC-010}/samples/04.sol (100%) rename src/{TSB-011 => TRC-011}/metadata.json (94%) rename src/{TSB-011 => TRC-011}/pattern.sol (100%) rename src/{TSB-011 => TRC-011}/samples/01.sol (100%) rename src/{TSB-011 => TRC-011}/samples/02.sol (100%) rename src/{TSB-011 => TRC-011}/samples/03.sol (100%) rename src/{TSB-011 => TRC-011}/samples/04.sol (100%) rename src/{TSB-012 => TRC-012}/metadata.json (93%) rename src/{TSB-012 => TRC-012}/pattern.sol (100%) rename src/{TSB-012 => TRC-012}/samples/01.sol (100%) rename src/{TSB-012 => TRC-012}/samples/02.sol (100%) rename src/{TSB-012 => TRC-012}/samples/03.sol (100%) rename src/{TSB-012 => TRC-012}/samples/04.sol (100%) rename src/{TSB-013 => TRC-013}/metadata.json (94%) rename src/{TSB-013 => TRC-013}/pattern.sol (100%) rename src/{TSB-013 => TRC-013}/samples/01.sol (100%) rename src/{TSB-013 => TRC-013}/samples/02.sol (100%) rename src/{TSB-013 => TRC-013}/samples/03.sol (100%) rename src/{TSB-013 => TRC-013}/samples/04.sol (100%) rename src/{TSB-014 => TRC-014}/metadata.json (94%) rename src/{TSB-014 => TRC-014}/pattern.sol (100%) rename src/{TSB-014 => TRC-014}/samples/01.sol (100%) rename src/{TSB-014 => TRC-014}/samples/02.sol (100%) rename src/{TSB-014 => TRC-014}/samples/03.sol (100%) rename src/{TSB-014 => TRC-014}/samples/04.sol (100%) rename src/{TSB-015 => TRC-015}/metadata.json (94%) rename src/{TSB-015 => TRC-015}/pattern.sol (100%) rename src/{TSB-015 => TRC-015}/samples/01.sol (100%) rename src/{TSB-015 => TRC-015}/samples/02.sol (100%) rename src/{TSB-015 => TRC-015}/samples/03.sol (100%) rename src/{TSB-015 => TRC-015}/samples/04.sol (100%) rename src/{TSB-016 => TRC-016}/metadata.json (94%) rename src/{TSB-016 => TRC-016}/pattern.sol (100%) rename src/{TSB-016 => TRC-016}/samples/01.sol (100%) rename src/{TSB-016 => TRC-016}/samples/02.sol (100%) rename src/{TSB-016 => TRC-016}/samples/03.sol (100%) rename src/{TSB-016 => TRC-016}/samples/04.sol (100%) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index be0d637..fb91d69 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,7 +6,7 @@ Fixes # **What type of PR is this?** -Please check [contributing guideline](https://cryptousersecurity.github.io/token-security-benchmark/contributing/) for more details. +Please check [contributing guideline](https://cryptousersecurity.github.io/token-risk-classification/contributing/) for more details. - [ ] Add a new risk type - [ ] Add a new risk sample - [ ] Documentation update diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8f32c3..49c57da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,10 @@ # Contribution Guidelines -This document describes the contribution guidelines for the Token Security Benchmark project. We welcome any contributions including adding new risk types, adding new risk samples, and updating the documentation, etc. +This document describes the contribution guidelines for the Token Risk Classification project. We welcome any contributions including adding new risk types, adding new risk samples, and updating the documentation, etc. ## Risk Type Format -All risk types are defined under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder with the name of the risk type ID. For example, `TSB-001`. The folder should contain the following folders and files: +All risk types are defined under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder with the name of the risk type ID. For example, `TRC-001`. The folder should contain the following folders and files: `metadata.json`: This file contains the metadata of the risk type. The metadata should be in the following format: ```json @@ -42,29 +42,29 @@ The fields in the metadata are: ### Add New Risk Samples to samples Folder -If you want to add new risk samples to an existing risk type, you can add the new risk samples to the `samples` folder of the risk type folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src). The sample contracts should be named as `NN.sol`, e.g., `01.sol`, `02.sol`, `03.sol`, etc. +If you want to add new risk samples to an existing risk type, you can add the new risk samples to the `samples` folder of the risk type folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src). The sample contracts should be named as `NN.sol`, e.g., `01.sol`, `02.sol`, `03.sol`, etc. ### Update metadata.json -Update the `samples` field in the `metadata.json` file of the risk type folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src). +Update the `samples` field in the `metadata.json` file of the risk type folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src). ## Contribute New Risk Types ### Request a Risk Type ID -Risk Type ID is defined in format `TSB-NNN` where `NNN` is the number of the risk type in that year. For example, `TSB-001`. -Before adding a new risk type, please check if the risk type ID is already taken. If not, please request a new risk type ID by creating an issue in this repository. You can check the taken risk type IDs in under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder. +Risk Type ID is defined in format `TRC-NNN` where `NNN` is the number of the risk type in that year. For example, `TRC-001`. +Before adding a new risk type, please check if the risk type ID is already taken. If not, please request a new risk type ID by creating an issue in this repository. You can check the taken risk type IDs in under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder. ### Create a new Risk Type Folder -Create a folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder with the name of the risk type ID. Add folders and files based on the [Risk Type Format](#risk-type-format) section. +Create a folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder with the name of the risk type ID. Add folders and files based on the [Risk Type Format](#risk-type-format) section. ## Update Documentation Everytime you add a new risk type or add new risk samples to an existing risk type, please update the documentation by executing the following command: ```bash make generate-docs ``` -This command will generate the documentation in [docs](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/docs) folder. +This command will generate the documentation in [docs](https://github.com/cryptousersecurity/token-risk-classification/tree/main/docs) folder. You can also preview the change by serving the documentation locally: ```bash mkdocs serve diff --git a/README.md b/README.md index 1a4504b..0baac0a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Token Security Benchmark +# Token Risk Classification -Token Security Benchmark(TSB) aims at identifying and cataloging scams like honeypots, and intentional backdoors that may be present in token smart contracts within the crypto ecosystem. This benchmark serves as: +Token Risk Classification(TRC) aims at identifying and cataloging scams like honeypots, and intentional backdoors that may be present in token smart contracts within the crypto ecosystem. This classification serves as: - **A Shield against Malicious Contracts:** By showcasing a defined list of malicious token contract patterns, it empowers users and project teams to recognize and steer clear of contracts with hidden intents, thereby ensuring safer interactions within the decentralized space. -- **A Testing Ground for Developers:** With a clear classification of malicious patterns and real-world examples, developers creating tools to detect these malicious token smart contracts can effectively evaluate their systems against a standardized benchmark. +- **A Testing Ground for Developers:** With a clear classification of malicious patterns and real-world examples, developers creating tools to detect these malicious token smart contracts can effectively evaluate their systems against a standardized classification. - **A Catalyst for Research:** By elucidating the deceitful practices adopted in token smart contracts, we aspire to drive more research towards crypto user safety, encouraging the community to devise strategies that deter such behaviors. diff --git a/docs/TRC-001.md b/docs/TRC-001.md new file mode 100644 index 0000000..2baf8b6 --- /dev/null +++ b/docs/TRC-001.md @@ -0,0 +1,13 @@ + +# TRC-001 Honeypot +## Description + +This is a honeypot smart contract sample demonstrating unpredictable behavior when storing a value that exceeds integer limitations. + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-001/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-001/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-001/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-001/samples/04.sol) +- [05.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-001/samples/05.sol) diff --git a/docs/TRC-002.md b/docs/TRC-002.md new file mode 100644 index 0000000..0cc2f9e --- /dev/null +++ b/docs/TRC-002.md @@ -0,0 +1,20 @@ + +# TRC-002 Mintable +## Description + +Changing the percentage of a position by increasing the balance at a specific address. + +## Risk Pattern + +```solidity +function mint(unit256 amount) external onlyowner { + _balances[_msgSender()] += amount; +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-002/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-002/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-002/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-002/samples/04.sol) diff --git a/docs/TRC-003.md b/docs/TRC-003.md new file mode 100644 index 0000000..3893cbc --- /dev/null +++ b/docs/TRC-003.md @@ -0,0 +1,26 @@ + +# TRC-003 OwnershipRetrieval +## Description + +When Owner permissions are set to a black hole address, it is still possible to fetch owner permissions back to an actionable address. + +## Risk Pattern + +```solidity +function lock(uint256 time) public virtual onlyOwner { + _previousOwner = _owner; + _owner = address(0); +} + +function unlock() public virtual { + require(_previousOwner == msg.sender, ); + _owner = _previousOwner; +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-003/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-003/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-003/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-003/samples/04.sol) diff --git a/docs/TRC-004.md b/docs/TRC-004.md new file mode 100644 index 0000000..8718921 --- /dev/null +++ b/docs/TRC-004.md @@ -0,0 +1,21 @@ + +# TRC-004 BalanceManipulation +## Description + +Changes can be made to the user's balance without the user's allowance to achieve a reduction in the percentage of the user's position. + +## Risk Pattern + +```solidity +function setBalance(address user, uint256 value) public onlyOwner returns (bool) { + _balances[user] = value + return true; +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-004/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-004/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-004/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-004/samples/04.sol) diff --git a/docs/TRC-005.md b/docs/TRC-005.md new file mode 100644 index 0000000..69db87d --- /dev/null +++ b/docs/TRC-005.md @@ -0,0 +1,20 @@ + +# TRC-005 HiddenOwnership +## Description + +To hide the status of a privileged address, set it to an unreadable address, or to name it using a non-standard method. + +## Risk Pattern + +```solidity +modifier superman() { + require(superman == _msgSender(), ); +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-005/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-005/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-005/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-005/samples/04.sol) diff --git a/docs/TRC-006.md b/docs/TRC-006.md new file mode 100644 index 0000000..60ea2a9 --- /dev/null +++ b/docs/TRC-006.md @@ -0,0 +1,20 @@ + +# TRC-006 SelfDestruction +## Description + +The contract can be destroyed, resulting in the loss of all functionality and zeroing of assets. + +## Risk Pattern + +```solidity +function close(address payable to) external onlyOwner { + selfdestruct(to); +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-006/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-006/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-006/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-006/samples/04.sol) diff --git a/docs/TRC-007.md b/docs/TRC-007.md new file mode 100644 index 0000000..83068ce --- /dev/null +++ b/docs/TRC-007.md @@ -0,0 +1,25 @@ + +# TRC-007 ExternalInvocation +## Description + +Certain functions or logic judgments within the contract rely on external contracts. + +## Risk Pattern + +```solidity +function _transfer(address from, address recipient, uint256 amount) internal virtual override returns (bool) { + require(_balances[_msgSender()] >= amount, ); + _balances[_msgSender()] -= amount; + _balances[recipient] += amount; + address1.transfer(amount); + emit Transfer(_msgSender(), recipient, amount); + return true; +} +``` + +## Risk Samples + +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-007/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-007/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-007/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-007/samples/04.sol) diff --git a/docs/TSB-008.md b/docs/TRC-008.md similarity index 51% rename from docs/TSB-008.md rename to docs/TRC-008.md index 3f8c173..63cf8d3 100644 --- a/docs/TSB-008.md +++ b/docs/TRC-008.md @@ -1,5 +1,5 @@ -# TSB-008 BlackListFunction +# TRC-008 BlackListFunction ## Description Restrict trading to specific addresses, preventing them from buying/selling, or selling only at a high loss @@ -19,7 +19,7 @@ function _transfer(address from, address recipient, uint256 amount) internal vir ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-008/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-008/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-008/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-008/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-008/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-008/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-008/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-008/samples/04.sol) diff --git a/docs/TSB-009.md b/docs/TRC-009.md similarity index 53% rename from docs/TSB-009.md rename to docs/TRC-009.md index 76afcb5..8efda0a 100644 --- a/docs/TSB-009.md +++ b/docs/TRC-009.md @@ -1,5 +1,5 @@ -# TSB-009 FullSaleRestriction +# TRC-009 FullSaleRestriction ## Description Users are unable to sell their entire position all at once. They can only trade a portion as a percentage or retain a certain amount of holdings. @@ -19,7 +19,7 @@ function _transfer(address from, address recipient, uint256 amount) internal vir ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-009/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-009/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-009/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-009/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-009/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-009/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-009/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-009/samples/04.sol) diff --git a/docs/TSB-010.md b/docs/TRC-010.md similarity index 52% rename from docs/TSB-010.md rename to docs/TRC-010.md index d31fedc..425fdd9 100644 --- a/docs/TSB-010.md +++ b/docs/TRC-010.md @@ -1,5 +1,5 @@ -# TSB-010 SlippageModification +# TRC-010 SlippageModification ## Description The transaction tax rate is subject to modification. @@ -23,7 +23,7 @@ function setFee(uint256 _fee) external onlyOwner{ ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-010/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-010/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-010/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-010/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-010/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-010/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-010/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-010/samples/04.sol) diff --git a/docs/TSB-011.md b/docs/TRC-011.md similarity index 55% rename from docs/TSB-011.md rename to docs/TRC-011.md index 16d85cf..87ec6a3 100644 --- a/docs/TSB-011.md +++ b/docs/TRC-011.md @@ -1,5 +1,5 @@ -# TSB-011 TransferPausable +# TRC-011 TransferPausable ## Description There is a toggle for trading. When the toggle is turned off, trading is restricted for non-designated addresses. @@ -23,7 +23,7 @@ function setTradeEnabled(bool _enabled) external onlyOwner { ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-011/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-011/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-011/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-011/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-011/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-011/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-011/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-011/samples/04.sol) diff --git a/docs/TSB-012.md b/docs/TRC-012.md similarity index 56% rename from docs/TSB-012.md rename to docs/TRC-012.md index b8db1ce..bf3aebb 100644 --- a/docs/TSB-012.md +++ b/docs/TRC-012.md @@ -1,5 +1,5 @@ -# TSB-012 PersonalSlippageModification +# TRC-012 PersonalSlippageModification ## Description Individual transaction taxes can be set for each address. @@ -25,7 +25,7 @@ function setFee(address _address, uint256 _fee) external onlyOwner{ ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-012/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-012/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-012/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-012/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-012/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-012/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-012/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-012/samples/04.sol) diff --git a/docs/TSB-013.md b/docs/TRC-013.md similarity index 54% rename from docs/TSB-013.md rename to docs/TRC-013.md index 75cd5dd..1cc9f38 100644 --- a/docs/TSB-013.md +++ b/docs/TRC-013.md @@ -1,5 +1,5 @@ -# TSB-013 TransactionWhitelisting +# TRC-013 TransactionWhitelisting ## Description There are certain privileged addresses that are not affected by trading restrictions or the need to pay transaction taxes. @@ -21,7 +21,7 @@ function _transfer(address from, address recipient, uint256 amount) internal vir ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-013/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-013/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-013/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-013/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-013/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-013/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-013/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-013/samples/04.sol) diff --git a/docs/TSB-014.md b/docs/TRC-014.md similarity index 51% rename from docs/TSB-014.md rename to docs/TRC-014.md index 49940c9..f205e65 100644 --- a/docs/TSB-014.md +++ b/docs/TRC-014.md @@ -1,5 +1,5 @@ -# TSB-014 AntiWhale +# TRC-014 AntiWhale ## Description The contract imposes restrictions on the maximum transaction volume or maximum holding amount. @@ -19,7 +19,7 @@ function _transfer(address from, address recipient, uint256 amount) internal vir ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-014/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-014/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-014/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-014/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-014/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-014/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-014/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-014/samples/04.sol) diff --git a/docs/TSB-015.md b/docs/TRC-015.md similarity index 54% rename from docs/TSB-015.md rename to docs/TRC-015.md index a713771..f9793f2 100644 --- a/docs/TSB-015.md +++ b/docs/TRC-015.md @@ -1,5 +1,5 @@ -# TSB-015 AntiWhaleModification +# TRC-015 AntiWhaleModification ## Description The maximum transaction volume or maximum holding restrictions can be modified. @@ -23,7 +23,7 @@ function setMaxAmount(uint256 _maxAmount) external onlyOwner { ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-015/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-015/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-015/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-015/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-015/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-015/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-015/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-015/samples/04.sol) diff --git a/docs/TSB-016.md b/docs/TRC-016.md similarity index 55% rename from docs/TSB-016.md rename to docs/TRC-016.md index 45d9109..bb26666 100644 --- a/docs/TSB-016.md +++ b/docs/TRC-016.md @@ -1,5 +1,5 @@ -# TSB-016 TradingCooldown +# TRC-016 TradingCooldown ## Description There needs to be a certain cooldown period between two transactions from the same address. @@ -20,7 +20,7 @@ function _transfer(address from, address recipient, uint256 amount) internal vir ## Risk Samples -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-016/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-016/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-016/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-016/samples/04.sol) +- [01.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-016/samples/01.sol) +- [02.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-016/samples/02.sol) +- [03.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-016/samples/03.sol) +- [04.sol](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/TRC-016/samples/04.sol) diff --git a/docs/TSB-001.md b/docs/TSB-001.md deleted file mode 100644 index 6dcd1c7..0000000 --- a/docs/TSB-001.md +++ /dev/null @@ -1,13 +0,0 @@ - -# TSB-001 Honeypot -## Description - -This is a honeypot smart contract sample demonstrating unpredictable behavior when storing a value that exceeds integer limitations. - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-001/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-001/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-001/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-001/samples/04.sol) -- [05.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-001/samples/05.sol) diff --git a/docs/TSB-002.md b/docs/TSB-002.md deleted file mode 100644 index d61ba10..0000000 --- a/docs/TSB-002.md +++ /dev/null @@ -1,20 +0,0 @@ - -# TSB-002 Mintable -## Description - -Changing the percentage of a position by increasing the balance at a specific address. - -## Risk Pattern - -```solidity -function mint(unit256 amount) external onlyowner { - _balances[_msgSender()] += amount; -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-002/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-002/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-002/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-002/samples/04.sol) diff --git a/docs/TSB-003.md b/docs/TSB-003.md deleted file mode 100644 index ed9980d..0000000 --- a/docs/TSB-003.md +++ /dev/null @@ -1,26 +0,0 @@ - -# TSB-003 OwnershipRetrieval -## Description - -When Owner permissions are set to a black hole address, it is still possible to fetch owner permissions back to an actionable address. - -## Risk Pattern - -```solidity -function lock(uint256 time) public virtual onlyOwner { - _previousOwner = _owner; - _owner = address(0); -} - -function unlock() public virtual { - require(_previousOwner == msg.sender, ); - _owner = _previousOwner; -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-003/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-003/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-003/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-003/samples/04.sol) diff --git a/docs/TSB-004.md b/docs/TSB-004.md deleted file mode 100644 index 779c522..0000000 --- a/docs/TSB-004.md +++ /dev/null @@ -1,21 +0,0 @@ - -# TSB-004 BalanceManipulation -## Description - -Changes can be made to the user's balance without the user's allowance to achieve a reduction in the percentage of the user's position. - -## Risk Pattern - -```solidity -function setBalance(address user, uint256 value) public onlyOwner returns (bool) { - _balances[user] = value - return true; -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-004/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-004/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-004/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-004/samples/04.sol) diff --git a/docs/TSB-005.md b/docs/TSB-005.md deleted file mode 100644 index 5f9b57f..0000000 --- a/docs/TSB-005.md +++ /dev/null @@ -1,20 +0,0 @@ - -# TSB-005 HiddenOwnership -## Description - -To hide the status of a privileged address, set it to an unreadable address, or to name it using a non-standard method. - -## Risk Pattern - -```solidity -modifier superman() { - require(superman == _msgSender(), ); -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-005/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-005/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-005/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-005/samples/04.sol) diff --git a/docs/TSB-006.md b/docs/TSB-006.md deleted file mode 100644 index b41498d..0000000 --- a/docs/TSB-006.md +++ /dev/null @@ -1,20 +0,0 @@ - -# TSB-006 SelfDestruction -## Description - -The contract can be destroyed, resulting in the loss of all functionality and zeroing of assets. - -## Risk Pattern - -```solidity -function close(address payable to) external onlyOwner { - selfdestruct(to); -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-006/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-006/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-006/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-006/samples/04.sol) diff --git a/docs/TSB-007.md b/docs/TSB-007.md deleted file mode 100644 index b4a0db4..0000000 --- a/docs/TSB-007.md +++ /dev/null @@ -1,25 +0,0 @@ - -# TSB-007 ExternalInvocation -## Description - -Certain functions or logic judgments within the contract rely on external contracts. - -## Risk Pattern - -```solidity -function _transfer(address from, address recipient, uint256 amount) internal virtual override returns (bool) { - require(_balances[_msgSender()] >= amount, ); - _balances[_msgSender()] -= amount; - _balances[recipient] += amount; - address1.transfer(amount); - emit Transfer(_msgSender(), recipient, amount); - return true; -} -``` - -## Risk Samples - -- [01.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-007/samples/01.sol) -- [02.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-007/samples/02.sol) -- [03.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-007/samples/03.sol) -- [04.sol](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/TSB-007/samples/04.sol) diff --git a/docs/contributing.md b/docs/contributing.md index c8f32c3..49c57da 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,10 +1,10 @@ # Contribution Guidelines -This document describes the contribution guidelines for the Token Security Benchmark project. We welcome any contributions including adding new risk types, adding new risk samples, and updating the documentation, etc. +This document describes the contribution guidelines for the Token Risk Classification project. We welcome any contributions including adding new risk types, adding new risk samples, and updating the documentation, etc. ## Risk Type Format -All risk types are defined under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder with the name of the risk type ID. For example, `TSB-001`. The folder should contain the following folders and files: +All risk types are defined under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder with the name of the risk type ID. For example, `TRC-001`. The folder should contain the following folders and files: `metadata.json`: This file contains the metadata of the risk type. The metadata should be in the following format: ```json @@ -42,29 +42,29 @@ The fields in the metadata are: ### Add New Risk Samples to samples Folder -If you want to add new risk samples to an existing risk type, you can add the new risk samples to the `samples` folder of the risk type folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src). The sample contracts should be named as `NN.sol`, e.g., `01.sol`, `02.sol`, `03.sol`, etc. +If you want to add new risk samples to an existing risk type, you can add the new risk samples to the `samples` folder of the risk type folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src). The sample contracts should be named as `NN.sol`, e.g., `01.sol`, `02.sol`, `03.sol`, etc. ### Update metadata.json -Update the `samples` field in the `metadata.json` file of the risk type folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src). +Update the `samples` field in the `metadata.json` file of the risk type folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src). ## Contribute New Risk Types ### Request a Risk Type ID -Risk Type ID is defined in format `TSB-NNN` where `NNN` is the number of the risk type in that year. For example, `TSB-001`. -Before adding a new risk type, please check if the risk type ID is already taken. If not, please request a new risk type ID by creating an issue in this repository. You can check the taken risk type IDs in under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder. +Risk Type ID is defined in format `TRC-NNN` where `NNN` is the number of the risk type in that year. For example, `TRC-001`. +Before adding a new risk type, please check if the risk type ID is already taken. If not, please request a new risk type ID by creating an issue in this repository. You can check the taken risk type IDs in under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder. ### Create a new Risk Type Folder -Create a folder under [src](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/src) folder with the name of the risk type ID. Add folders and files based on the [Risk Type Format](#risk-type-format) section. +Create a folder under [src](https://github.com/cryptousersecurity/token-risk-classification/tree/main/src) folder with the name of the risk type ID. Add folders and files based on the [Risk Type Format](#risk-type-format) section. ## Update Documentation Everytime you add a new risk type or add new risk samples to an existing risk type, please update the documentation by executing the following command: ```bash make generate-docs ``` -This command will generate the documentation in [docs](https://github.com/cryptousersecurity/token-security-benchmark/tree/main/docs) folder. +This command will generate the documentation in [docs](https://github.com/cryptousersecurity/token-risk-classification/tree/main/docs) folder. You can also preview the change by serving the documentation locally: ```bash mkdocs serve diff --git a/docs/index.md b/docs/index.md index 47f2325..6cf20e7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,10 +1,10 @@ -# Token Security Benchmark +# Token Risk Classification -Token Security Benchmark(TSB) aims at identifying and cataloging scams like honeypots, and intentional backdoors that may be present in token smart contracts within the crypto ecosystem. This benchmark serves as: +Token Risk Classification(TRC) aims at identifying and cataloging scams like honeypots, and intentional backdoors that may be present in token smart contracts within the crypto ecosystem. This classification serves as: - **A Shield against Malicious Contracts:** By showcasing a defined list of malicious token contract patterns, it empowers users and project teams to recognize and steer clear of contracts with hidden intents, thereby ensuring safer interactions within the decentralized space. -- **A Testing Ground for Developers:** With a clear classification of malicious patterns and real-world examples, developers creating tools to detect these malicious token smart contracts can effectively evaluate their systems against a standardized benchmark. +- **A Testing Ground for Developers:** With a clear classification of malicious patterns and real-world examples, developers creating tools to detect these malicious token smart contracts can effectively evaluate their systems against a standardized classification. - **A Catalyst for Research:** By elucidating the deceitful practices adopted in token smart contracts, we aspire to drive more research towards crypto user safety, encouraging the community to devise strategies that deter such behaviors. diff --git a/go.mod b/go.mod index de45ddb..7ae1b1d 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/cryptousersecurity/token-security-benchmark +module github.com/cryptousersecurity/token-risk-classification go 1.20 diff --git a/hack/gendocs/main.go b/hack/gendocs/main.go index 319d468..180ff5f 100644 --- a/hack/gendocs/main.go +++ b/hack/gendocs/main.go @@ -40,9 +40,9 @@ const itemTemplate = ` ## Risk Samples {{ range .Samples }} {{- if eq 0 .Start .End }} -- [{{ .Name }}](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/{{ $.ID }}/samples/{{ .Name }}) +- [{{ .Name }}](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/{{ $.ID }}/samples/{{ .Name }}) {{- else }} -- [{{ .Name }}](https://github.com/cryptousersecurity/token-security-benchmark/blob/main/src/{{ $.ID }}/samples/{{ .Name }}#L{{ .Start }}-L{{ .End }}) +- [{{ .Name }}](https://github.com/cryptousersecurity/token-risk-classification/blob/main/src/{{ $.ID }}/samples/{{ .Name }}#L{{ .Start }}-L{{ .End }}) {{- end }} {{- end }} ` @@ -55,7 +55,7 @@ func main() { } for _, entry := range entries { - if entry.IsDir() && strings.HasPrefix(entry.Name(), "TSB-") { + if entry.IsDir() && strings.HasPrefix(entry.Name(), "TRC-") { itemPath := filepath.Join(src, entry.Name()) item, err := parseRiskItem(itemPath) if err != nil { diff --git a/mkdocs.yml b/mkdocs.yml index ddcbe44..85f30e5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ -site_name: Token Security Benchmark -site_description: Token Security Benchmark -repo_url: https://github.com/cryptousersecurity/token-security-benchmark -repo_name: token-security-benchmark +site_name: Token Risk Classification +site_description: Token Risk Classification +repo_url: https://github.com/cryptousersecurity/token-risk-classification +repo_name: token-risk-classification strict: true theme: name: "material" @@ -15,20 +15,20 @@ markdown_extensions: nav: - Overview: index.md - Risk Types: - - TSB-001 Honeypot: TSB-001.md - - TSB-002 Mintable: TSB-002.md - - TSB-003 OwnershipRetrieval: TSB-003.md - - TSB-004 BalanceManipulation: TSB-004.md - - TSB-005 HiddenOwnership: TSB-005.md - - TSB-006 SelfDestruction: TSB-006.md - - TSB-007 ExternalInvocation: TSB-007.md - - TSB-008 BlackListFunction: TSB-008.md - - TSB-009 FullSaleRestriction: TSB-009.md - - TSB-010 SlippageModification: TSB-010.md - - TSB-011 TransferPausable: TSB-011.md - - TSB-012 PersonalSlippageModification: TSB-012.md - - TSB-013 TransactionWhitelisting: TSB-013.md - - TSB-014 AntiWhale: TSB-014.md - - TSB-015 AntiWhaleModification: TSB-015.md - - TSB-016 TradingCooldown: TSB-016.md + - TRC-001 Honeypot: TRC-001.md + - TRC-002 Mintable: TRC-002.md + - TRC-003 OwnershipRetrieval: TRC-003.md + - TRC-004 BalanceManipulation: TRC-004.md + - TRC-005 HiddenOwnership: TRC-005.md + - TRC-006 SelfDestruction: TRC-006.md + - TRC-007 ExternalInvocation: TRC-007.md + - TRC-008 BlackListFunction: TRC-008.md + - TRC-009 FullSaleRestriction: TRC-009.md + - TRC-010 SlippageModification: TRC-010.md + - TRC-011 TransferPausable: TRC-011.md + - TRC-012 PersonalSlippageModification: TRC-012.md + - TRC-013 TransactionWhitelisting: TRC-013.md + - TRC-014 AntiWhale: TRC-014.md + - TRC-015 AntiWhaleModification: TRC-015.md + - TRC-016 TradingCooldown: TRC-016.md - Contributing: contributing.md diff --git a/src/TSB-001/metadata.json b/src/TRC-001/metadata.json similarity index 95% rename from src/TSB-001/metadata.json rename to src/TRC-001/metadata.json index da1b8e5..0ff47c6 100644 --- a/src/TSB-001/metadata.json +++ b/src/TRC-001/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-001", + "id": "TRC-001", "name": "Honeypot", "description": "This is a honeypot smart contract sample demonstrating unpredictable behavior when storing a value that exceeds integer limitations.", "samples": [ diff --git a/src/TSB-001/samples/01.sol b/src/TRC-001/samples/01.sol similarity index 100% rename from src/TSB-001/samples/01.sol rename to src/TRC-001/samples/01.sol diff --git a/src/TSB-001/samples/02.sol b/src/TRC-001/samples/02.sol similarity index 100% rename from src/TSB-001/samples/02.sol rename to src/TRC-001/samples/02.sol diff --git a/src/TSB-001/samples/03.sol b/src/TRC-001/samples/03.sol similarity index 100% rename from src/TSB-001/samples/03.sol rename to src/TRC-001/samples/03.sol diff --git a/src/TSB-001/samples/04.sol b/src/TRC-001/samples/04.sol similarity index 100% rename from src/TSB-001/samples/04.sol rename to src/TRC-001/samples/04.sol diff --git a/src/TSB-001/samples/05.sol b/src/TRC-001/samples/05.sol similarity index 100% rename from src/TSB-001/samples/05.sol rename to src/TRC-001/samples/05.sol diff --git a/src/TSB-002/metadata.json b/src/TRC-002/metadata.json similarity index 93% rename from src/TSB-002/metadata.json rename to src/TRC-002/metadata.json index 0b6d7e8..4efe919 100644 --- a/src/TSB-002/metadata.json +++ b/src/TRC-002/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-002", + "id": "TRC-002", "name": "Mintable", "description": "Changing the percentage of a position by increasing the balance at a specific address.", "samples": [ diff --git a/src/TSB-002/pattern.sol b/src/TRC-002/pattern.sol similarity index 100% rename from src/TSB-002/pattern.sol rename to src/TRC-002/pattern.sol diff --git a/src/TSB-002/samples/01.sol b/src/TRC-002/samples/01.sol similarity index 100% rename from src/TSB-002/samples/01.sol rename to src/TRC-002/samples/01.sol diff --git a/src/TSB-002/samples/02.sol b/src/TRC-002/samples/02.sol similarity index 100% rename from src/TSB-002/samples/02.sol rename to src/TRC-002/samples/02.sol diff --git a/src/TSB-002/samples/03.sol b/src/TRC-002/samples/03.sol similarity index 100% rename from src/TSB-002/samples/03.sol rename to src/TRC-002/samples/03.sol diff --git a/src/TSB-002/samples/04.sol b/src/TRC-002/samples/04.sol similarity index 100% rename from src/TSB-002/samples/04.sol rename to src/TRC-002/samples/04.sol diff --git a/src/TSB-003/metadata.json b/src/TRC-003/metadata.json similarity index 94% rename from src/TSB-003/metadata.json rename to src/TRC-003/metadata.json index ede8403..733fcb9 100644 --- a/src/TSB-003/metadata.json +++ b/src/TRC-003/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-003", + "id": "TRC-003", "name": "OwnershipRetrieval", "description": "When Owner permissions are set to a black hole address, it is still possible to fetch owner permissions back to an actionable address.", "samples": [ diff --git a/src/TSB-003/pattern.sol b/src/TRC-003/pattern.sol similarity index 100% rename from src/TSB-003/pattern.sol rename to src/TRC-003/pattern.sol diff --git a/src/TSB-003/samples/01.sol b/src/TRC-003/samples/01.sol similarity index 100% rename from src/TSB-003/samples/01.sol rename to src/TRC-003/samples/01.sol diff --git a/src/TSB-003/samples/02.sol b/src/TRC-003/samples/02.sol similarity index 100% rename from src/TSB-003/samples/02.sol rename to src/TRC-003/samples/02.sol diff --git a/src/TSB-003/samples/03.sol b/src/TRC-003/samples/03.sol similarity index 100% rename from src/TSB-003/samples/03.sol rename to src/TRC-003/samples/03.sol diff --git a/src/TSB-003/samples/04.sol b/src/TRC-003/samples/04.sol similarity index 100% rename from src/TSB-003/samples/04.sol rename to src/TRC-003/samples/04.sol diff --git a/src/TSB-004/metadata.json b/src/TRC-004/metadata.json similarity index 94% rename from src/TSB-004/metadata.json rename to src/TRC-004/metadata.json index 2294658..5073e0d 100644 --- a/src/TSB-004/metadata.json +++ b/src/TRC-004/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-004", + "id": "TRC-004", "name": "BalanceManipulation", "description": "Changes can be made to the user's balance without the user's allowance to achieve a reduction in the percentage of the user's position.", "samples": [ diff --git a/src/TSB-004/pattern.sol b/src/TRC-004/pattern.sol similarity index 100% rename from src/TSB-004/pattern.sol rename to src/TRC-004/pattern.sol diff --git a/src/TSB-004/samples/01.sol b/src/TRC-004/samples/01.sol similarity index 100% rename from src/TSB-004/samples/01.sol rename to src/TRC-004/samples/01.sol diff --git a/src/TSB-004/samples/02.sol b/src/TRC-004/samples/02.sol similarity index 100% rename from src/TSB-004/samples/02.sol rename to src/TRC-004/samples/02.sol diff --git a/src/TSB-004/samples/03.sol b/src/TRC-004/samples/03.sol similarity index 100% rename from src/TSB-004/samples/03.sol rename to src/TRC-004/samples/03.sol diff --git a/src/TSB-004/samples/04.sol b/src/TRC-004/samples/04.sol similarity index 100% rename from src/TSB-004/samples/04.sol rename to src/TRC-004/samples/04.sol diff --git a/src/TSB-005/metadata.json b/src/TRC-005/metadata.json similarity index 94% rename from src/TSB-005/metadata.json rename to src/TRC-005/metadata.json index fdcec9e..c87dd50 100644 --- a/src/TSB-005/metadata.json +++ b/src/TRC-005/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-005", + "id": "TRC-005", "name": "HiddenOwnership", "description": "To hide the status of a privileged address, set it to an unreadable address, or to name it using a non-standard method.", "samples": [ diff --git a/src/TSB-005/pattern.sol b/src/TRC-005/pattern.sol similarity index 100% rename from src/TSB-005/pattern.sol rename to src/TRC-005/pattern.sol diff --git a/src/TSB-005/samples/01.sol b/src/TRC-005/samples/01.sol similarity index 100% rename from src/TSB-005/samples/01.sol rename to src/TRC-005/samples/01.sol diff --git a/src/TSB-005/samples/02.sol b/src/TRC-005/samples/02.sol similarity index 100% rename from src/TSB-005/samples/02.sol rename to src/TRC-005/samples/02.sol diff --git a/src/TSB-005/samples/03.sol b/src/TRC-005/samples/03.sol similarity index 100% rename from src/TSB-005/samples/03.sol rename to src/TRC-005/samples/03.sol diff --git a/src/TSB-005/samples/04.sol b/src/TRC-005/samples/04.sol similarity index 100% rename from src/TSB-005/samples/04.sol rename to src/TRC-005/samples/04.sol diff --git a/src/TSB-006/metadata.json b/src/TRC-006/metadata.json similarity index 94% rename from src/TSB-006/metadata.json rename to src/TRC-006/metadata.json index 6926468..c7128d9 100644 --- a/src/TSB-006/metadata.json +++ b/src/TRC-006/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-006", + "id": "TRC-006", "name": "SelfDestruction", "description": "The contract can be destroyed, resulting in the loss of all functionality and zeroing of assets.", "samples": [ diff --git a/src/TSB-006/pattern.sol b/src/TRC-006/pattern.sol similarity index 100% rename from src/TSB-006/pattern.sol rename to src/TRC-006/pattern.sol diff --git a/src/TSB-006/samples/01.sol b/src/TRC-006/samples/01.sol similarity index 100% rename from src/TSB-006/samples/01.sol rename to src/TRC-006/samples/01.sol diff --git a/src/TSB-006/samples/02.sol b/src/TRC-006/samples/02.sol similarity index 100% rename from src/TSB-006/samples/02.sol rename to src/TRC-006/samples/02.sol diff --git a/src/TSB-006/samples/03.sol b/src/TRC-006/samples/03.sol similarity index 100% rename from src/TSB-006/samples/03.sol rename to src/TRC-006/samples/03.sol diff --git a/src/TSB-006/samples/04.sol b/src/TRC-006/samples/04.sol similarity index 100% rename from src/TSB-006/samples/04.sol rename to src/TRC-006/samples/04.sol diff --git a/src/TSB-007/metadata.json b/src/TRC-007/metadata.json similarity index 94% rename from src/TSB-007/metadata.json rename to src/TRC-007/metadata.json index 9ada8b4..eba0527 100644 --- a/src/TSB-007/metadata.json +++ b/src/TRC-007/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-007", + "id": "TRC-007", "name": "ExternalInvocation", "description": "Certain functions or logic judgments within the contract rely on external contracts.", "samples": [ diff --git a/src/TSB-007/pattern.sol b/src/TRC-007/pattern.sol similarity index 100% rename from src/TSB-007/pattern.sol rename to src/TRC-007/pattern.sol diff --git a/src/TSB-007/samples/01.sol b/src/TRC-007/samples/01.sol similarity index 100% rename from src/TSB-007/samples/01.sol rename to src/TRC-007/samples/01.sol diff --git a/src/TSB-007/samples/02.sol b/src/TRC-007/samples/02.sol similarity index 100% rename from src/TSB-007/samples/02.sol rename to src/TRC-007/samples/02.sol diff --git a/src/TSB-007/samples/03.sol b/src/TRC-007/samples/03.sol similarity index 100% rename from src/TSB-007/samples/03.sol rename to src/TRC-007/samples/03.sol diff --git a/src/TSB-007/samples/04.sol b/src/TRC-007/samples/04.sol similarity index 100% rename from src/TSB-007/samples/04.sol rename to src/TRC-007/samples/04.sol diff --git a/src/TSB-008/metadata.json b/src/TRC-008/metadata.json similarity index 94% rename from src/TSB-008/metadata.json rename to src/TRC-008/metadata.json index 53c2e7d..08a2fd4 100644 --- a/src/TSB-008/metadata.json +++ b/src/TRC-008/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-008", + "id": "TRC-008", "name": "BlackListFunction", "description": "Restrict trading to specific addresses, preventing them from buying/selling, or selling only at a high loss", "samples": [ diff --git a/src/TSB-008/pattern.sol b/src/TRC-008/pattern.sol similarity index 100% rename from src/TSB-008/pattern.sol rename to src/TRC-008/pattern.sol diff --git a/src/TSB-008/samples/01.sol b/src/TRC-008/samples/01.sol similarity index 100% rename from src/TSB-008/samples/01.sol rename to src/TRC-008/samples/01.sol diff --git a/src/TSB-008/samples/02.sol b/src/TRC-008/samples/02.sol similarity index 100% rename from src/TSB-008/samples/02.sol rename to src/TRC-008/samples/02.sol diff --git a/src/TSB-008/samples/03.sol b/src/TRC-008/samples/03.sol similarity index 100% rename from src/TSB-008/samples/03.sol rename to src/TRC-008/samples/03.sol diff --git a/src/TSB-008/samples/04.sol b/src/TRC-008/samples/04.sol similarity index 100% rename from src/TSB-008/samples/04.sol rename to src/TRC-008/samples/04.sol diff --git a/src/TSB-009/metadata.json b/src/TRC-009/metadata.json similarity index 95% rename from src/TSB-009/metadata.json rename to src/TRC-009/metadata.json index 9b575da..987fe50 100644 --- a/src/TSB-009/metadata.json +++ b/src/TRC-009/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-009", + "id": "TRC-009", "name": "FullSaleRestriction", "description": "Users are unable to sell their entire position all at once. They can only trade a portion as a percentage or retain a certain amount of holdings.", "samples": [ diff --git a/src/TSB-009/pattern.sol b/src/TRC-009/pattern.sol similarity index 100% rename from src/TSB-009/pattern.sol rename to src/TRC-009/pattern.sol diff --git a/src/TSB-009/samples/01.sol b/src/TRC-009/samples/01.sol similarity index 100% rename from src/TSB-009/samples/01.sol rename to src/TRC-009/samples/01.sol diff --git a/src/TSB-009/samples/02.sol b/src/TRC-009/samples/02.sol similarity index 100% rename from src/TSB-009/samples/02.sol rename to src/TRC-009/samples/02.sol diff --git a/src/TSB-009/samples/03.sol b/src/TRC-009/samples/03.sol similarity index 100% rename from src/TSB-009/samples/03.sol rename to src/TRC-009/samples/03.sol diff --git a/src/TSB-009/samples/04.sol b/src/TRC-009/samples/04.sol similarity index 100% rename from src/TSB-009/samples/04.sol rename to src/TRC-009/samples/04.sol diff --git a/src/TSB-010/metadata.json b/src/TRC-010/metadata.json similarity index 93% rename from src/TSB-010/metadata.json rename to src/TRC-010/metadata.json index 43ed2bc..8735ce6 100644 --- a/src/TSB-010/metadata.json +++ b/src/TRC-010/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-010", + "id": "TRC-010", "name": "SlippageModification", "description": "The transaction tax rate is subject to modification.", "samples": [ diff --git a/src/TSB-010/pattern.sol b/src/TRC-010/pattern.sol similarity index 100% rename from src/TSB-010/pattern.sol rename to src/TRC-010/pattern.sol diff --git a/src/TSB-010/samples/01.sol b/src/TRC-010/samples/01.sol similarity index 100% rename from src/TSB-010/samples/01.sol rename to src/TRC-010/samples/01.sol diff --git a/src/TSB-010/samples/02.sol b/src/TRC-010/samples/02.sol similarity index 100% rename from src/TSB-010/samples/02.sol rename to src/TRC-010/samples/02.sol diff --git a/src/TSB-010/samples/03.sol b/src/TRC-010/samples/03.sol similarity index 100% rename from src/TSB-010/samples/03.sol rename to src/TRC-010/samples/03.sol diff --git a/src/TSB-010/samples/04.sol b/src/TRC-010/samples/04.sol similarity index 100% rename from src/TSB-010/samples/04.sol rename to src/TRC-010/samples/04.sol diff --git a/src/TSB-011/metadata.json b/src/TRC-011/metadata.json similarity index 94% rename from src/TSB-011/metadata.json rename to src/TRC-011/metadata.json index 350f5a7..8907c63 100644 --- a/src/TSB-011/metadata.json +++ b/src/TRC-011/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-011", + "id": "TRC-011", "name": "TransferPausable", "description": "There is a toggle for trading. When the toggle is turned off, trading is restricted for non-designated addresses.", "samples": [ diff --git a/src/TSB-011/pattern.sol b/src/TRC-011/pattern.sol similarity index 100% rename from src/TSB-011/pattern.sol rename to src/TRC-011/pattern.sol diff --git a/src/TSB-011/samples/01.sol b/src/TRC-011/samples/01.sol similarity index 100% rename from src/TSB-011/samples/01.sol rename to src/TRC-011/samples/01.sol diff --git a/src/TSB-011/samples/02.sol b/src/TRC-011/samples/02.sol similarity index 100% rename from src/TSB-011/samples/02.sol rename to src/TRC-011/samples/02.sol diff --git a/src/TSB-011/samples/03.sol b/src/TRC-011/samples/03.sol similarity index 100% rename from src/TSB-011/samples/03.sol rename to src/TRC-011/samples/03.sol diff --git a/src/TSB-011/samples/04.sol b/src/TRC-011/samples/04.sol similarity index 100% rename from src/TSB-011/samples/04.sol rename to src/TRC-011/samples/04.sol diff --git a/src/TSB-012/metadata.json b/src/TRC-012/metadata.json similarity index 93% rename from src/TSB-012/metadata.json rename to src/TRC-012/metadata.json index 72d1373..bd2f88a 100644 --- a/src/TSB-012/metadata.json +++ b/src/TRC-012/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-012", + "id": "TRC-012", "name": "PersonalSlippageModification", "description": "Individual transaction taxes can be set for each address.", "samples": [ diff --git a/src/TSB-012/pattern.sol b/src/TRC-012/pattern.sol similarity index 100% rename from src/TSB-012/pattern.sol rename to src/TRC-012/pattern.sol diff --git a/src/TSB-012/samples/01.sol b/src/TRC-012/samples/01.sol similarity index 100% rename from src/TSB-012/samples/01.sol rename to src/TRC-012/samples/01.sol diff --git a/src/TSB-012/samples/02.sol b/src/TRC-012/samples/02.sol similarity index 100% rename from src/TSB-012/samples/02.sol rename to src/TRC-012/samples/02.sol diff --git a/src/TSB-012/samples/03.sol b/src/TRC-012/samples/03.sol similarity index 100% rename from src/TSB-012/samples/03.sol rename to src/TRC-012/samples/03.sol diff --git a/src/TSB-012/samples/04.sol b/src/TRC-012/samples/04.sol similarity index 100% rename from src/TSB-012/samples/04.sol rename to src/TRC-012/samples/04.sol diff --git a/src/TSB-013/metadata.json b/src/TRC-013/metadata.json similarity index 94% rename from src/TSB-013/metadata.json rename to src/TRC-013/metadata.json index b391b06..cdd6c15 100644 --- a/src/TSB-013/metadata.json +++ b/src/TRC-013/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-013", + "id": "TRC-013", "name": "TransactionWhitelisting", "description": "There are certain privileged addresses that are not affected by trading restrictions or the need to pay transaction taxes.", "samples": [ diff --git a/src/TSB-013/pattern.sol b/src/TRC-013/pattern.sol similarity index 100% rename from src/TSB-013/pattern.sol rename to src/TRC-013/pattern.sol diff --git a/src/TSB-013/samples/01.sol b/src/TRC-013/samples/01.sol similarity index 100% rename from src/TSB-013/samples/01.sol rename to src/TRC-013/samples/01.sol diff --git a/src/TSB-013/samples/02.sol b/src/TRC-013/samples/02.sol similarity index 100% rename from src/TSB-013/samples/02.sol rename to src/TRC-013/samples/02.sol diff --git a/src/TSB-013/samples/03.sol b/src/TRC-013/samples/03.sol similarity index 100% rename from src/TSB-013/samples/03.sol rename to src/TRC-013/samples/03.sol diff --git a/src/TSB-013/samples/04.sol b/src/TRC-013/samples/04.sol similarity index 100% rename from src/TSB-013/samples/04.sol rename to src/TRC-013/samples/04.sol diff --git a/src/TSB-014/metadata.json b/src/TRC-014/metadata.json similarity index 94% rename from src/TSB-014/metadata.json rename to src/TRC-014/metadata.json index 9f7f29a..8890c40 100644 --- a/src/TSB-014/metadata.json +++ b/src/TRC-014/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-014", + "id": "TRC-014", "name": "AntiWhale", "description": "The contract imposes restrictions on the maximum transaction volume or maximum holding amount.", "samples": [ diff --git a/src/TSB-014/pattern.sol b/src/TRC-014/pattern.sol similarity index 100% rename from src/TSB-014/pattern.sol rename to src/TRC-014/pattern.sol diff --git a/src/TSB-014/samples/01.sol b/src/TRC-014/samples/01.sol similarity index 100% rename from src/TSB-014/samples/01.sol rename to src/TRC-014/samples/01.sol diff --git a/src/TSB-014/samples/02.sol b/src/TRC-014/samples/02.sol similarity index 100% rename from src/TSB-014/samples/02.sol rename to src/TRC-014/samples/02.sol diff --git a/src/TSB-014/samples/03.sol b/src/TRC-014/samples/03.sol similarity index 100% rename from src/TSB-014/samples/03.sol rename to src/TRC-014/samples/03.sol diff --git a/src/TSB-014/samples/04.sol b/src/TRC-014/samples/04.sol similarity index 100% rename from src/TSB-014/samples/04.sol rename to src/TRC-014/samples/04.sol diff --git a/src/TSB-015/metadata.json b/src/TRC-015/metadata.json similarity index 94% rename from src/TSB-015/metadata.json rename to src/TRC-015/metadata.json index 551395d..e83ea27 100644 --- a/src/TSB-015/metadata.json +++ b/src/TRC-015/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-015", + "id": "TRC-015", "name": "AntiWhaleModification", "description": "The maximum transaction volume or maximum holding restrictions can be modified.", "samples": [ diff --git a/src/TSB-015/pattern.sol b/src/TRC-015/pattern.sol similarity index 100% rename from src/TSB-015/pattern.sol rename to src/TRC-015/pattern.sol diff --git a/src/TSB-015/samples/01.sol b/src/TRC-015/samples/01.sol similarity index 100% rename from src/TSB-015/samples/01.sol rename to src/TRC-015/samples/01.sol diff --git a/src/TSB-015/samples/02.sol b/src/TRC-015/samples/02.sol similarity index 100% rename from src/TSB-015/samples/02.sol rename to src/TRC-015/samples/02.sol diff --git a/src/TSB-015/samples/03.sol b/src/TRC-015/samples/03.sol similarity index 100% rename from src/TSB-015/samples/03.sol rename to src/TRC-015/samples/03.sol diff --git a/src/TSB-015/samples/04.sol b/src/TRC-015/samples/04.sol similarity index 100% rename from src/TSB-015/samples/04.sol rename to src/TRC-015/samples/04.sol diff --git a/src/TSB-016/metadata.json b/src/TRC-016/metadata.json similarity index 94% rename from src/TSB-016/metadata.json rename to src/TRC-016/metadata.json index a935379..6eefff9 100644 --- a/src/TSB-016/metadata.json +++ b/src/TRC-016/metadata.json @@ -1,5 +1,5 @@ { - "id": "TSB-016", + "id": "TRC-016", "name": "TradingCooldown", "description": "There needs to be a certain cooldown period between two transactions from the same address.", "samples": [ diff --git a/src/TSB-016/pattern.sol b/src/TRC-016/pattern.sol similarity index 100% rename from src/TSB-016/pattern.sol rename to src/TRC-016/pattern.sol diff --git a/src/TSB-016/samples/01.sol b/src/TRC-016/samples/01.sol similarity index 100% rename from src/TSB-016/samples/01.sol rename to src/TRC-016/samples/01.sol diff --git a/src/TSB-016/samples/02.sol b/src/TRC-016/samples/02.sol similarity index 100% rename from src/TSB-016/samples/02.sol rename to src/TRC-016/samples/02.sol diff --git a/src/TSB-016/samples/03.sol b/src/TRC-016/samples/03.sol similarity index 100% rename from src/TSB-016/samples/03.sol rename to src/TRC-016/samples/03.sol diff --git a/src/TSB-016/samples/04.sol b/src/TRC-016/samples/04.sol similarity index 100% rename from src/TSB-016/samples/04.sol rename to src/TRC-016/samples/04.sol