Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8ad57a3
Migrated to OZ v5
KyrylR Mar 24, 2025
bed7a53
integrated with new versions of solarity and openzeppelin
aritkulova Mar 26, 2025
9812e15
updated package-lock
aritkulova Mar 26, 2025
c382599
switched to custom errors
aritkulova Mar 27, 2025
23ace8e
cleaned up
aritkulova Mar 27, 2025
1118e7f
refactored error naming
aritkulova Mar 27, 2025
764dc9a
renamed claimTopicKey to contextKey, claimTopic to handleTopic
aritkulova Mar 31, 2025
c9fe3e0
fixed typos
aritkulova Apr 2, 2025
b73bba0
fixed inits in example
aritkulova Apr 2, 2025
58c7181
returned accidentally missing part
aritkulova Apr 2, 2025
aac0246
updated examples folder
aritkulova Apr 4, 2025
8d8d53d
Added erc721 (#7)
aritkulova Apr 8, 2025
554b25e
fixed typos
aritkulova Apr 8, 2025
cbfa65d
created IAssetF interface for Context and common errors
aritkulova Apr 8, 2025
29e3462
added onlyInitializing to init functions
aritkulova Apr 8, 2025
54539df
updated minimal solidity version to ^0.8.21
aritkulova Apr 9, 2025
e3fb73f
added storage buckets to the modules
aritkulova Apr 9, 2025
4f42e86
updated the architecture diagram
aritkulova Apr 9, 2025
8d67588
updated version to 0.3.0
aritkulova Apr 9, 2025
93fd17f
added tokenURI to NFTF
aritkulova Apr 11, 2025
759f311
updated diagram to capture ERC20 and ERC721
aritkulova Apr 11, 2025
383263f
updated dependency
aritkulova Apr 14, 2025
c7aaa95
fixed diagram
aritkulova Apr 15, 2025
3bccb9f
few fixes
Arvolear Apr 16, 2025
bede6ef
moved TokenF and NFTF contracts from core folder
aritkulova Apr 16, 2025
ce475a0
updated diagram
aritkulova Apr 16, 2025
3442b57
calldata -> memory in public functions
aritkulova Apr 16, 2025
04e3b12
TransferLimitsModule -> ERC20TransferLimitsModule
aritkulova Apr 16, 2025
4829b56
EquityNFT -> LandNFT
aritkulova Apr 16, 2025
f3d61ec
added ERC721TransferLimitsModule
aritkulova Apr 17, 2025
dfc5a46
added LandERC721TransferLimitsModule to examples
aritkulova Apr 17, 2025
af81d51
added INFTF to supported interfaces
aritkulova Apr 17, 2025
d6b676a
updated scripts
aritkulova Apr 17, 2025
8ecf012
added AbstractAssetF contract
aritkulova Apr 18, 2025
798f81e
order consistency fix
aritkulova Apr 18, 2025
8d39297
fixed ERC721TransferLimitsModule formula
aritkulova Apr 18, 2025
9bddc87
cleaned up ERC721TransferLimitsModule test
aritkulova Apr 18, 2025
6b1dead
review fix
aritkulova Apr 20, 2025
80fa17b
updated diagram
aritkulova Apr 20, 2025
5797088
fix
aritkulova Apr 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"func-visibility": "off",
"max-states-count": "off",
"not-rely-on-time": "off",
"compiler-version": "off"
"compiler-version": "off",
"func-name-mixedcase": "off",
"no-inline-assembly": "off"
}
}
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@

Bring Real World Assets (RWA) on-chain via flexible tokenization framework - TokenF.

!["TokenF Architecture"](https://github.com/dl-tokenf/core-contracts/assets/47551140/9e912d07-bc4d-407d-bf25-859e0da40f32)
TokenF architecture:

!["TokenF Architecture"](https://github.com/user-attachments/assets/9bc70097-6fa2-4fc6-a7d2-e64298afca6c)

NFTF architecture:

!["NFTF Architecture"](https://github.com/user-attachments/assets/1858dcfd-0851-49c6-88ca-fa6bf317470f)

Built with [Solarity](https://github.com/dl-solarity), [Openzeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts), and aspiration to perfection.

## Application

TokenF is an on-chain framework that enables development, management, and deployment of permissioned ERC-20-compatible assets on EVM networks. TokenF enables custom rules to be configured for RWA tokens, providing flexible KYC/AML and regulatory compliance checks for the users to abide during interaction with the smart contracts.
TokenF is an on-chain framework that enables development, management, and deployment of permissioned ERC-20-compatible and ERC-721-compatible assets on EVM networks. TokenF enables custom rules to be configured for RWA tokens, providing flexible KYC/AML and regulatory compliance checks for the users to abide during interaction with the smart contracts.

TokenF is built with certain levels of abstraction in mind:

Expand Down Expand Up @@ -41,7 +47,7 @@ npm install @tokenf/contracts
You will then be able to start using TokenF:

```solidity
pragma solidity ^0.8.20;
pragma solidity ^0.8.21;

import {TokenF} from "@tokenf/contracts/core/TokenF.sol";

Expand All @@ -50,6 +56,18 @@ contract EquityToken is TokenF {
}
```

or NFTF:

```solidity
pragma solidity ^0.8.21;

import {NFTF} from "@tokenf/contracts/core/NFTF.sol";

contract EquityNft is NFTF {
. . .
}
```

> [!TIP]
> Check out the `examples` directory to learn how to bring your RWA on-chain!

Expand Down
13 changes: 6 additions & 7 deletions contracts/core/AgentAccessControl.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.21;

import {DiamondAccessControl} from "@solarity/solidity-lib/diamond/access/access-control/DiamondAccessControl.sol";
import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";

import {IAgentAccessControl} from "../interfaces/IAgentAccessControl.sol";

Expand All @@ -16,15 +16,14 @@ import {AgentAccessControlStorage} from "./storages/AgentAccessControlStorage.so
abstract contract AgentAccessControl is
IAgentAccessControl,
AgentAccessControlStorage,
DiamondAccessControl
AccessControlUpgradeable
{
/// @inheritdoc IAgentAccessControl
bytes32 public constant AGENT_ROLE = keccak256("AGENT_ROLE");

function __AgentAccessControl_init()
internal
onlyInitializing(AGENT_ACCESS_CONTROL_STORAGE_SLOT)
{
function __AgentAccessControl_init() internal onlyInitializing {
_grantRole(DEFAULT_ADMIN_ROLE, _msgSender());

grantRole(AGENT_ROLE, msg.sender);
}

Expand Down
11 changes: 6 additions & 5 deletions contracts/core/KYCCompliance.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.21;

import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

import {SetHelper} from "@solarity/solidity-lib/libs/arrays/SetHelper.sol";

import {IKYCCompliance} from "../interfaces/IKYCCompliance.sol";

import {IAssetF} from "../interfaces/IAssetF.sol";

import {AgentAccessControl} from "./AgentAccessControl.sol";
import {TokenF} from "./TokenF.sol";
import {KYCComplianceStorage} from "./storages/KYCComplianceStorage.sol";

import {AbstractKYCModule} from "../modules/AbstractKYCModule.sol";
Expand All @@ -17,13 +18,13 @@ import {AbstractKYCModule} from "../modules/AbstractKYCModule.sol";
* @notice The KYCCompliance contract
*
* The KYCCompliance is a core contract that serves as a repository for KYC modules.
* It tracks every transfer made within the TokenF contract and disseminates its context to registered KYC modules.
* It tracks every transfer made within the TokenF and NFTF contracts and disseminates its context to registered KYC modules.
*/
abstract contract KYCCompliance is IKYCCompliance, KYCComplianceStorage, AgentAccessControl {
using EnumerableSet for EnumerableSet.AddressSet;
using SetHelper for EnumerableSet.AddressSet;

function __KYCCompliance_init() internal onlyInitializing(KYC_COMPLIANCE_STORAGE_SLOT) {}
function __KYCCompliance_init() internal onlyInitializing {}

/// @inheritdoc IKYCCompliance
function addKYCModules(
Expand All @@ -40,7 +41,7 @@ abstract contract KYCCompliance is IKYCCompliance, KYCComplianceStorage, AgentAc
}

/// @inheritdoc IKYCCompliance
function isKYCed(TokenF.Context memory ctx_) public view virtual returns (bool) {
function isKYCed(IAssetF.Context memory ctx_) public view virtual returns (bool) {
address[] memory regulatoryModules_ = getKYCModules();

for (uint256 i = 0; i < regulatoryModules_.length; ++i) {
Expand Down
Loading