@oamo/contracts
v0.2.17
Published
Collection of Solidity Smart-Contract used by Oamo.io
Downloads
67
Readme
Oamo - Smart-Contracts
Table of contents
General info
This repository is composed of the Smart Contracts that are used by the Oamo. There is currently 2 main Smart Contracts:
- DataPool.sol: ERC721 contract that represent the ownership of a data pool. (non transferable)
- Vault.sol: Contract receiving and distributing rewards to participants of a data pool.
This repository also include many tests for the Smart Contracts, the tests are written using Foundry and Hardhat.
The Smart Contracts are intended to be deployed on the Polygon Network.
DataPool: 0x33AA4Cf440e8d2A1c37A5aD7be356E1ffB28F76d
Vault: 0x8c07df06DED7D71A71E776425ff905c10f558D2A
Multi-Sig Wallet: 0x05a0F169084836C68a85E55DF8d61F2fEbe881fb (Owning the Admin Proxy and Admin Role on both Smart Contracts)
Functionality
The main functionality of the Smart Contracts are the ability to create Data Pool and participate in them. To create a new Data Pool or participate in them, the transaction must be first signed by an Oracle. The Oracle is a trusted third party that is responsible for verifying the validity of the transaction and signing it. The Oracle has also the capability to execute the transaction.
Each Data Pool is represented as a NFT, that been said the functionality to transfer the ownership of the NFT has been disabled.
To be completed
More detail to come
Security
The 2 main Smart Contracts in this repository (DataPool and Vault) are intended to be deployed as Upgradeable Smart Contracts. Using the OpenZeppelin Transparent Proxy pattern, the upgradeability is achieved by using a Proxy contract that delegates all calls to an implementation contract. The implementation contract can be upgraded by the owner of the AdminProxy contract.
To ensure the security of the upgradeability mechanism, the AdminProxy contract is owned by a MultiSig wallet. The MultiSig wallet is controlled by 5 owners and a threshold of 3 signatures is required for any transaction to be executed.
Both Smart Contracts also use a system of roles to restrict access to certain functions. The roles are managed by the AccessControl contract from OpenZeppelin. The 2 roles currently in use by both smart contracts are:
- Admin: Can assign or remove role to other addresses
- Oracle: Can approve or execute createDataPool and participate functions
The Admin role is assigned to the same MultiSig wallet that owns the AdminProxy contract.
To be implemented The Oracle role is assign to a separate MultiSig wallet that is controlled by 3 owners, with a threshold of 2 signatures required for any transaction to be executed.
Setup
Install Dependencies
yarn install
Run test with Hardhat
npx hardhat test
List all Hardhat tasks
npx hardhat help
Run test with Foundry
forge test