Skip to content

Commit

Permalink
Merge pull request #13 from Aboudjem/features/README
Browse files Browse the repository at this point in the history
Features/readme
  • Loading branch information
Aboudjem authored May 18, 2023
2 parents 2db6113 + 25a64f5 commit e5dd79a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 45 deletions.
70 changes: 27 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,60 @@
# ERC-3643:

## RAPTOR: Simplified and Optimized T-REX Implementation
## RAPTOR: An Educational Approach to the T-REX Standard

## Introduction

<p align="center">
<img alt="T-Rex Raptor" src="./docs/img/Raptor.png" height=150px>
</p>
Welcome to **ERC-3643 Raptor Version** 🦖! This project is a fork of the [**T-Rex (ERC-3643) standard**](https://github.com/TokenySolutions/T-REX/), which was originally developed by @TokenySolutions. As one of the authors of the ERC-3643, I have worked on this fork independently with the goal of creating a simplified, optimized, and more accessible version. The Raptor aims to make working with security tokens easier to understand and more user-friendly, without attempting to compete with the original T-Rex implementation.

<p align="center">
<img alt="T-Rex Raptor" src="./docs/img/philosoraptor.png" height=350px>
</p>
## Why Raptor?
Welcome to the **Raptor Version of ERC-3643** 🦖! This project is a respectful nod to the [**T-Rex (ERC-3643) standard**](https://github.com/TokenySolutions/T-REX/), developed by [@TokenySolutions](https://github.com/TokenySolutions).

![Why?](https://media0.giphy.com/media/3o7btPCcdNniyf0ArS/giphy.gif)
I had the privilege of contributing to the original ERC-3643. Inspired by that work, I've created a simpler version. This isn't about competition with T-Rex, it's about sharing knowledge and making it easier for everyone to understand this great piece of technology. 🧩

A Raptor is a smaller, lighter dinosaur — just like this project. Raptor is a leaner, more efficient take on the T-Rex standard. By streamlining the original, we've made it more accessible and easier to grasp for everyone.
It's my personal take on the ERC-3643 (T-Rex) and it's _made for learning purposes_.

## Changes & Updates
> ⚠️ 🛑 This ERC-3643-Raptor project is **not audited** and **not meant for production use**. **If you want to implement ERC-3643 in real-world, I strongly recommend getting in touch with [@TokenySolutions](https://github.com/TokenySolutions).**
![Instagram Influencer GIF by Social Nomads](https://media2.giphy.com/media/irIRA0HQCQiTiIMMNm/giphy.gif?cid=ecf05e47qqzltc3e4038f3cguk4d2n8bo2fso7jpequhj6o9&ep=v1_gifs_search&rid=giphy.gif&ct=g)
<p align="center">
<img alt="T-Rex Raptor" src="./docs/img/raptor-philo.png" height=350px>
</p>

Compared to the original T-Rex standard, Raptor has undergone several major changes:
## Why Raptor?

### 🎛️ Optimized
A Raptor is a smaller dinosaur, like this project. I've tried to make this version of the T-Rex standard lighter and easier to understand.
RAPTOR stands for **R**egulated **A**sset **P**latform for **T**okenized **O**perations & **R**esources

- `isVerified` function is now more streamlined and efficient.
- Type casting instances have been minimized by directly changing the types of function parameters.
- Unnecessary checks and logic have been removed to save gas.
- `_msgSender()` function from OpenZeppelin's `Context` contract is used for consistent message sender's address retrieval in meta-transactions.
## What's Different?

### ❌ Removed
![Instagram Influencer GIF by Social Nomads](https://media2.giphy.com/media/irIRA0HQCQiTiIMMNm/giphy.gif?cid=ecf05e47qqzltc3e4038f3cguk4d2n8bo2fso7jpequhj6o9&ep=v1_gifs_search&rid=giphy.gif&ct=g)

- Proxies have been removed from the project, simplifying the structure and reducing gas cost.
- Removed `UpdatedTokenInformation` event
- Removed `setName`, `setSymbol`, and `setDecimals` functions for closer adherence to the ERC20 standard.
- Redundant checks for empty strings in the `_name` and `_symbol` parameters have been removed.
Raptor is a simplified take on the T-Rex standard. It's stripped back to make it easier to understand. Some functions have been removed or optimized to make things clearer.

### ➕ Added
- No Proxy Implementation: The proxy contract included in the original T-Rex standard has been removed in Raptor. The proxy contract is typically used for upgradability, but it can add complexity, especially for those new to smart contract development.

- `UpdatedOnchainID` event has been introduced.
- Several internal and private functions have been added to optimize gas cost and enhance code clarity.
- No DVD (Delivery Versus Delivery)

### ⚙️ Updated
- Reduced Compliance Features: While T-REX includes a detailed compliance layer for regulated tokens, Raptor has simplified these mechanisms. This change was made to focus on core functionalities and improve understandability.

- Role management now utilizes OpenZeppelin's `AccessControl` instead of `AgentRole`.
- Custom `Pausable` mechanism has been replaced with OpenZeppelin's `Pausable` for better flexibility and compatibility.
- Event parameters have been updated with respective interface types.
- A check for array mismatches has been added for improved robustness.
- The `batchTransferFrom` function is added for efficient multiple transfers.
- Streamlined Functionality: Some features from the original T-Rex, such as setName, setSymbol, and setDecimals functions, have been removed in Raptor to align more closely with the standard ERC20 token where these properties are typically immutable.

### 📝 Documentation
- Role Management Update: Role management in Raptor now uses OpenZeppelin's AccessControl instead of AgentRole, making it easier to manage access rights.

- Inline documentation has been substantially improved and expanded.
- Simplified Pausable Mechanism: The custom Pausable mechanism in the T-Rex has been replaced with OpenZeppelin's Pausable in Raptor. This update provides better compatibility with other contracts and libraries.

### 🧪 Tests
- Batch Transfer Feature: Raptor includes a batchTransferFrom function, making it possible to make multiple transfers in a single transaction, potentially saving on gas costs.

- Tests have been updated to reflect the changes in contract logic.
- Updated Documentation: The inline documentation has been expanded and updated in Raptor, making it easier for developers to understand the contract's functionalities.

For a detailed list of changes, refer to the project's [Change Log](#).
These changes are not an attempt to improve or critique the T-Rex standard. They were made to provide a simplified, more accessible version of the ERC-3643 standard for **educational purposes**. If you're interested in a comprehensive and production-ready implementation, I recommend exploring the original T-Rex standard by [@TokenySolutions](https://github.com/TokenySolutions/T-REX).

## Credits
For a detailed look at the changes, check out the project's [Change Log](./CHANGELOG.md)

![Credits](https://media2.giphy.com/media/dzaUX7CAG0Ihi/giphy.gif)
## Thanks

A huge shoutout to @TokenySolutions for the original T-Rex standard. Raptor is a humble effort to present their work in a more accessible, streamlined format.
Many thanks to my former colleagues at @TokenySolutions for their exceptional work in developing the original T-Rex standard. My Raptor project is a personal endeavor, a way for me to revisit this impressive work, simplify it, and make it easier to understand.

## Keywords

ERC3643, ERC-3643, Security tokens, regulated tokens, T-Rex Standard, Raptor

## Conclusion

Raptor, as a lighter and more optimized version of T-Rex (ERC-3643), is designed to bring the power of security tokens to the community in an accessible and understandable format. Dive
Raptor is my personal, educational take on the T-Rex (ERC-3643) standard. It's here to help make the world of security tokens more accessible. Take a look, learn something, and remember to get in touch with @TokenySolutions if you want to use the ERC-3643 in production.
19 changes: 19 additions & 0 deletions T-REX-LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
NOTICE

The T-REX software is licensed under a proprietary license or the GPL v.3.
If you choose to receive it under the GPL v.3 license, the following applies:

T-REX is a suite of smart contracts developed by Tokeny to manage and transfer financial assets on the ethereum blockchain
Copyright (C) 2022, Tokeny sàrl.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
6 changes: 4 additions & 2 deletions contracts/token/Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ contract Token is IToken, AccessControl, Pausable {

_forcedTransfer(lostWallet, newWallet, investorBalance);

if (frozenTokens > 0) {
if (frozenTokens != 0) {
_freezePartialTokens(newWallet, frozenTokens);
}
if (isLostWalletFrozen == true) {
Expand Down Expand Up @@ -707,7 +707,9 @@ contract Token is IToken, AccessControl, Pausable {
_frozenAmounts[account] >= amount,
"Amount should be less than or equal to frozen tokens"
);
_frozenAmounts[account] = _frozenAmounts[account] - (amount);
unchecked {
_frozenAmounts[account] = _frozenAmounts[account] - (amount);
}
emit TokensUnfrozen(account, amount);
}
}
Binary file removed docs/img/philosoraptor.png
Binary file not shown.
Binary file added docs/img/raptor-philo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5dd79a

Please sign in to comment.