This repository contains the Solidity smart contracts that power the Riskophobe protocol. The contracts enable decentralized options trading, allowing users to buy tokens with the flexibility to return them and reclaim their collateral.
The smart contracts in this repository are developed using the Hardhat framework. They are designed to be efficient, transparent, and secure, adhering to best practices in Ethereum smart contract development.
Key features:
- Options Trading: Supports the creation and management of tokenized options.
- Collateral Management: Handles collateral deposits and returns securely.
- Fee Mechanism: Enables fee collection for offer creators.
- Event Logging: Emits events for transparency and off-chain integrations.
Riskophobe Protocol is deployed on the Base network:
0x0bBEeEab55594F1A03A2b34A6e454fb1d85519e4
Ensure you have the following installed before proceeding:
Follow these steps to set up the project:
# Clone the repository
$ git clone https://github.com/your-repo/riskophobe-contracts.git
# Navigate into the project directory
$ cd riskophobe-contracts
# Using npm
$ npm install
# Or using yarn
$ yarn install
Compile the Solidity contracts using the Hardhat framework:
# Using npm
$ npx hardhat compile
# Or using yarn
$ yarn hardhat compile
Run the test suite to ensure contract functionality:
# Using npm
$ npx hardhat test
# Or using yarn
$ yarn hardhat test
Deploy the contracts to a local or test network:
- Configure the network in
hardhat.config.ts
. - Run the deployment script:
# Using npm
$ npx hardhat run scripts/deploy.ts --network <network-name>
# Or using yarn
$ yarn hardhat run scripts/deploy.ts --network <network-name>
Check the code for linting issues:
# Using npm
$ npm run lint
# Or using yarn
$ yarn lint
The repository is organized as follows:
contracts/
├── RiskophobeProtocol.sol # Main protocol contract
scripts/
├── deploy.ts # Deployment script
test/
├── RiskophobeProtocol.test.ts # Unit tests
hardhat.config.ts # Hardhat configuration file
- Hardhat: Development environment for Ethereum smart contracts
- Solidity: Smart contract programming language
- TypeScript: Scripting and testing language
- Ethers.js: Library for Ethereum blockchain interactions
- Mocha & Chai: Testing framework and assertion library
This project is licensed under the MIT License. See the LICENSE
file for details.