Skip to content

Commit

Permalink
remove editBid
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranquil-Flow committed Jun 20, 2024
1 parent d2b3736 commit 2dc1b48
Show file tree
Hide file tree
Showing 16 changed files with 750 additions and 809 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<div align="center">
<h1 align="center">🔏 CarnationFM</h1>

![Screenshot 2024-05-26 105040](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/4f0eaaac-e9d8-46f1-8b8f-9346535414d9)
</div>

Established systems are failing.

Carnation is an experiment in decentralized and encrypted communication with a focus on music as transport vessel caring hidden messages. It empowers users to broadcast their voice and coordinate with others securely and privately all while safeguarding their anonymity.
Contribute with an audio file (wav, flac) and weave in an encrypted message into to subsonic frequencies. This hidden channel allows for discreet communication.

![user flow (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/135f25c7-0fb4-402a-b1a0-7464657b0ce7)

Carnation prioritizes anonymity, letting your voice be heard without compromising your safety. It thrives on community. It's a space for collaboration, where people can unite and coordinate towards a shared vision.
Imagine the underprivileged individuals and collectives whose message is embedded in the music, broadcasted for all to hear, yet only those who know where to look can decipher it.

**Check out our slides - [here](https://github.com/Tranquil-Flow/carnation-radio/blob/main/SLIDES.md) <br><br>**
**Check out our demo - [here](https://kapture-debelg-debelgs-projects.vercel.app/) <br><br>**

We have created [CLI](https://github.com/Tranquil-Flow/carnation-radio/tree/main/whistle) for encryption of the message into the wav file which is then uploaded onto **ETHSwarm** decentralized data storage. We have deployed our frontend via **Scaffold-ETH2** and deployed our smart contracts for auction of the 24h playlist NFT (funding mechanism for data storage) on ETHSepolia.

Details of the subsonic steganography scheme and instructions can be explored - [here](https://github.com/Tranquil-Flow/carnation-radio/blob/subsonic-steganography/steganography/README.md)

![tech stack (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/874b9f9b-c39a-48e0-b6eb-5687fec31f51)

Auction.sol on Sepolia - [here](https://sepolia.etherscan.io/address/0x4894421a7c0bc369a5c10ddbaf4dbc7cf3b72ae5#code)

AudioSetNFT.sol on Sepolia - [here](https://sepolia.etherscan.io/address/0x75993080804d364419445175c5a543eda6a20bb0#code)
<div align="center">
<h1 align="center">🔏 CarnationFM</h1>

![Screenshot 2024-05-26 105040](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/4f0eaaac-e9d8-46f1-8b8f-9346535414d9)
</div>

Established systems are failing.

Carnation is an experiment in decentralized and encrypted communication with a focus on music as transport vessel caring hidden messages. It empowers users to broadcast their voice and coordinate with others securely and privately all while safeguarding their anonymity.
Contribute with an audio file (wav, flac) and weave in an encrypted message into to subsonic frequencies. This hidden channel allows for discreet communication.

![user flow (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/135f25c7-0fb4-402a-b1a0-7464657b0ce7)

Carnation prioritizes anonymity, letting your voice be heard without compromising your safety. It thrives on community. It's a space for collaboration, where people can unite and coordinate towards a shared vision.
Imagine the underprivileged individuals and collectives whose message is embedded in the music, broadcasted for all to hear, yet only those who know where to look can decipher it.

**Check out our slides - [here](https://github.com/Tranquil-Flow/carnation-radio/blob/main/SLIDES.md) <br><br>**
**Check out our demo - [here](https://kapture-debelg-debelgs-projects.vercel.app/) <br><br>**

We have created [CLI](https://github.com/Tranquil-Flow/carnation-radio/tree/main/whistle) for encryption of the message into the wav file which is then uploaded onto **ETHSwarm** decentralized data storage. We have deployed our frontend via **Scaffold-ETH2** and deployed our smart contracts for auction of the 24h playlist NFT (funding mechanism for data storage) on ETHSepolia.

Details of the subsonic steganography scheme and instructions can be explored - [here](https://github.com/Tranquil-Flow/carnation-radio/blob/subsonic-steganography/steganography/README.md)

![tech stack (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/874b9f9b-c39a-48e0-b6eb-5687fec31f51)

Auction.sol on Sepolia - [here](https://sepolia.etherscan.io/address/0x4894421a7c0bc369a5c10ddbaf4dbc7cf3b72ae5#code)

AudioSetNFT.sol on Sepolia - [here](https://sepolia.etherscan.io/address/0x75993080804d364419445175c5a543eda6a20bb0#code)
18 changes: 9 additions & 9 deletions SLIDES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div align="center">
<h1 align="center">CarnationFM</h1>

![slide1 (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/b6a920f2-4061-498c-81e1-c89827636140)
![why (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/e5c71b8c-41e4-48d8-ba98-28a8704473b5)
![what (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/52677190-bad4-4b2c-a65d-c815d761b08e)
![ui](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/5b9e1893-9916-47a6-89a4-efb888ac752d)
![user flow (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/79402701-3dda-4273-a848-e51590dc87b7)
![tech stack (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/e45b96ad-d924-4ebe-bc8a-fd2f65aa722d)
<div align="center">
<h1 align="center">CarnationFM</h1>

![slide1 (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/b6a920f2-4061-498c-81e1-c89827636140)
![why (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/e5c71b8c-41e4-48d8-ba98-28a8704473b5)
![what (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/52677190-bad4-4b2c-a65d-c815d761b08e)
![ui](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/5b9e1893-9916-47a6-89a4-efb888ac752d)
![user flow (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/79402701-3dda-4273-a848-e51590dc87b7)
![tech stack (2)](https://github.com/Tranquil-Flow/carnation-radio/assets/101796507/e45b96ad-d924-4ebe-bc8a-fd2f65aa722d)
23 changes: 0 additions & 23 deletions packages/hardhat/contracts/Auction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,6 @@ contract Auction is ReentrancyGuard {
emit BidRemoved(_audioSlotID, msg.sender);
}

function editBid(uint _audioSlotID) external payable nonReentrant {
AudioSlot storage slot = audioSlots[_audioSlotID];
Bid storage existingBid = bids[_audioSlotID][msg.sender];

// Check the auction is ongoing
if (block.timestamp < slot.auctionStartTime) {revert AuctionNotStarted();}
if (block.timestamp > slot.auctionStartTime + auctionLength) {revert AuctionAlreadyEnded();}

// Check bid amount is greater than zero
if (msg.value == 0) {revert BidAmountZero();}

// Transfer the bid amount to the contract
(bool success, ) = address(this).call{value: msg.value}("");
if (!success) {revert ETHTransferInFailed();}

// Update the bid amount
uint newBidAmount = existingBid.bidAmount + msg.value;
existingBid.bidAmount = newBidAmount;

emit BidRemoved(_audioSlotID, msg.sender);
emit BidPlaced(_audioSlotID, msg.sender, newBidAmount);
}

function startAuction(uint _audioSlotID, string calldata _audioName) external {
AudioSlot storage slot = audioSlots[_audioSlotID];

Expand Down
94 changes: 47 additions & 47 deletions packages/hardhat/deploy/00_deploy_your_contract.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";

const deployContracts: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;
const { ethers } = hre;

// Deploy the Auction contract
const auctionDeployment = await deploy("Auction", {
from: deployer,
log: true,
autoMine: true,
});

const auctionContractAddress = auctionDeployment.address;
if (!auctionContractAddress) {
throw new Error("Failed to get Auction contract address");
}

// Deploy the AudioSetNFT contract with the Auction contract address as an argument
const audioSetNFTDeployment = await deploy("AudioSetNFT", {
from: deployer,
args: [auctionContractAddress],
log: true,
autoMine: true,
});

const audioSetNFTContractAddress = audioSetNFTDeployment.address;
if (!audioSetNFTContractAddress) {
throw new Error("Failed to get AudioSetNFT contract address");
}

// Get the Auction contract instance
const auctionContract = await ethers.getContractAt("Auction", auctionContractAddress);

// Call the defineNFTcontract function on the Auction contract with the address of the deployed AudioSetNFT contract
const tx = await auctionContract.defineNFTcontract(audioSetNFTContractAddress);
await tx.wait();

console.log(`Auction contract deployed at: ${auctionContractAddress}`);
console.log(`AudioSetNFT contract deployed at: ${audioSetNFTContractAddress}`);
};

export default deployContracts;

deployContracts.tags = ["Auction", "AudioSetNFT"];
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";

const deployContracts: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;
const { ethers } = hre;

// Deploy the Auction contract
const auctionDeployment = await deploy("Auction", {
from: deployer,
log: true,
autoMine: true,
});

const auctionContractAddress = auctionDeployment.address;
if (!auctionContractAddress) {
throw new Error("Failed to get Auction contract address");
}

// Deploy the AudioSetNFT contract with the Auction contract address as an argument
const audioSetNFTDeployment = await deploy("AudioSetNFT", {
from: deployer,
args: [auctionContractAddress],
log: true,
autoMine: true,
});

const audioSetNFTContractAddress = audioSetNFTDeployment.address;
if (!audioSetNFTContractAddress) {
throw new Error("Failed to get AudioSetNFT contract address");
}

// Get the Auction contract instance
const auctionContract = await ethers.getContractAt("Auction", auctionContractAddress);

// Call the defineNFTcontract function on the Auction contract with the address of the deployed AudioSetNFT contract
const tx = await auctionContract.defineNFTcontract(audioSetNFTContractAddress);
await tx.wait();

console.log(`Auction contract deployed at: ${auctionContractAddress}`);
console.log(`AudioSetNFT contract deployed at: ${audioSetNFTContractAddress}`);
};

export default deployContracts;

deployContracts.tags = ["Auction", "AudioSetNFT"];
71 changes: 0 additions & 71 deletions packages/nextjs/app/page-old.tsx

This file was deleted.

107 changes: 71 additions & 36 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,71 @@
"use client";
import React, { useState } from 'react';
import '../styles/App.css';
import Navbar from '../components/Navbar';
import AuctionView from '../components/AuctionView';
// import background from '../components/assets/background.svg';

import Link from "next/link";
import type { NextPage } from "next";
import { useAccount } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Address } from "~~/components/scaffold-eth";

const Home: NextPage = () => {
const { address: connectedAddress } = useAccount();

const [view, setView] = useState('listen');

const handleNavClick = (view) => {
setView(view);
};

return (
<div className="app">
{/* <div className="app" style={{ backgroundImage: `url(${background})` }}> */}
<Navbar currentView={view} onNavClick={handleNavClick} />
<div className="main-content">
{view === 'auction' && <AuctionView />}
{/* Add the listen view component here */}
</div>
</div>
);

};

export default Home;
"use client";

import Link from "next/link";
import type { NextPage } from "next";
import { useAccount } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Address } from "~~/components/scaffold-eth";

const Home: NextPage = () => {
const { address: connectedAddress } = useAccount();

return (
<>
<div className="flex items-center flex-col flex-grow pt-10">
<div className="px-5">
<h1 className="text-center">
<span className="block text-2xl mb-2">Welcome to</span>
<span className="block text-4xl font-bold">Scaffold-ETH 2</span>
</h1>
<div className="flex justify-center items-center space-x-2">
<p className="my-2 font-medium">Connected Address:</p>
<Address address={connectedAddress} />
</div>
<p className="text-center text-lg">
Get started by editing{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/nextjs/app/page.tsx
</code>
</p>
<p className="text-center text-lg">
Edit your smart contract{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
YourContract.sol
</code>{" "}
in{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/hardhat/contracts
</code>
</p>
</div>

<div className="flex-grow bg-base-300 w-full mt-16 px-8 py-12">
<div className="flex justify-center items-center gap-12 flex-col sm:flex-row">
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<BugAntIcon className="h-8 w-8 fill-secondary" />
<p>
Tinker with your smart contract using the{" "}
<Link href="/debug" passHref className="link">
Debug Contracts
</Link>{" "}
tab.
</p>
</div>
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<MagnifyingGlassIcon className="h-8 w-8 fill-secondary" />
<p>
Explore your local transactions with the{" "}
<Link href="/blockexplorer" passHref className="link">
Block Explorer
</Link>{" "}
tab.
</p>
</div>
</div>
</div>
</div>
</>
);
};

export default Home;
Loading

0 comments on commit 2dc1b48

Please sign in to comment.