Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
102 changes: 30 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,30 @@
<!--
parent:
order: false
-->

<div align="center">
<h1> Fishcake Contracts Repo</h1>
</div>

<div align="center">
<a href="https://github.com/FishcakeLab/fishcake-contracts/releases/latest">
<img alt="Version" src="https://img.shields.io/github/tag/FishcakeLab/fishcake-contracts.svg" />
</a>
<a href="https://github.com/FishcakeLab/fishcake-contracts/blob/main/LICENSE">
<img alt="License: Apache-2.0" src="https://img.shields.io/github/license/FishcakeLab/fishcake-contracts.svg" />
</a>
</div>

Fishcake Contracts Project

## Installation

For prerequisites and detailed build instructions please read the [Installation](https://github.com/FishcakeLab/fishcake-contracts/) instructions. Once the dependencies are installed, run:

```bash
git submodule update --init --recursive --remote
```
or
```bash
forge install foundry-rs/forge-std --no-commit
forge install OpenZeppelin/openzeppelin-contracts-upgradeable --no-commit
forge install OpenZeppelin/openzeppelin-contracts --no-commit
forge install OpenZeppelin/openzeppelin-foundry-upgrades --no-commit
```

Or check out the latest [release](https://github.com/FishcakeLab/fishcake-contracts).

## Test And Depoly

```bash
$env:PRIVATE_KEY = "0x2a871"
$env:USDT_ADDRESS = "0x3C4249f1cDfaAAFf"
$env:OPENZEPPELIN_BASH_PATH = "C:/Users/65126/Documents/Git/bin/bash.exe"
```


### test
```
forge test --ffi
```

### Depoly

```
forge script script/DeployerV2.s.sol:DeployerScript --rpc-url $RPC_URL --private-key $PRIVKEY --ffi

```

### Upgrade

```
forge script script/UpgradeInvestorSalePoolDeployerV2.s.sol:UpgradeInvestorSalePoolDeployer --rpc-url $RPC_URL --private-key $PRIVKEY --ffi
```

## Community


## Contributing

Looking for a good place to start contributing? Check out some [`good first issues`](https://github.com/FishcakeLab/fishcake-contracts/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).

For additional instructions, standards and style guides, please refer to the [Contributing](./CONTRIBUTING.md) document.
# My Fishcake Multi-Chain Event Manager – Hackathon Project (Direction 2)

Simplified, USDT-only Event Manager contract for Fishcake (AI × Web3 Hackathon).

## What I Built
- Forked original Fishcake repo
- Removed all non-core features (FCC mining, NFT logic, complex rewards)
- Focused on **USDT stablecoin activities**
- Added upgradeability (Transparent Proxy via OpenZeppelin)
- Security: ReentrancyGuard, Pausable, SafeERC20, emergency withdraw
- Basic frontend attempt (React + wagmi + RainbowKit still building..)
- Local deployment proof with Foundry Anvil

## Requirements Met (Direction 2)
- ✅ Supports multi-chain deployment (pure EVM Solidity)
- ✅ Simplified ecological functions, core only
- ✅ USDT stablecoin-based activities
- ✅ Consistent logic across chains
- ✅ Event creation, reward distribution, verification/finish

## Tech Stack
- Solidity 0.8.26 + Foundry
- OpenZeppelin upgradeable contracts

## Future Plans
- Deploy to Sepolia + BSC Testnet when test ETH is available
- Add USDC support + token registry
- Build a full React frontend using wagmi + RainbowKit, with event listing, creation flows, and enhanced UI/UX.

Open to feedback & collaboration!
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
2 changes: 1 addition & 1 deletion lib/openzeppelin-foundry-upgrades
Submodule openzeppelin-foundry-upgrades updated 41 files
+5 −0 .gitignore
+0 −3 .gitmodules
+29 −0 CHANGELOG.md
+1 −1 LICENSE
+63 −23 README.md
+4 −0 docs/modules/api/pages/Options.adoc
+34 −0 docs/modules/api/pages/api-foundry-upgrades.adoc
+62 −24 docs/modules/pages/foundry-upgrades.adoc
+17 −1 foundry.toml
+1 −1 lib/forge-std
+0 −1 lib/solidity-stringutils
+18 −5 package.json
+19 −0 scripts/test-reference-builds.sh
+37 −2 src/Options.sol
+12 −0 src/Upgrades.sol
+75 −22 src/internal/Core.sol
+50 −34 src/internal/DefenderDeploy.sol
+46 −0 src/internal/StringFinder.sol
+23 −34 src/internal/Utils.sol
+2 −2 src/internal/Versions.sol
+0 −0 test-profiles/build-info-v1/src/.gitkeep
+6 −0 test-profiles/build-info-v1/test/contracts/MyContract.sol
+0 −0 test-profiles/build-info-v2-bad/src/.gitkeep
+32 −0 test-profiles/build-info-v2-bad/test/Upgrades.t.sol
+7 −0 test-profiles/build-info-v2-bad/test/contracts/MyContract.sol
+0 −0 test-profiles/build-info-v2-reference-contract/src/.gitkeep
+21 −0 test-profiles/build-info-v2-reference-contract/test/Upgrades.t.sol
+7 −0 test-profiles/build-info-v2-reference-contract/test/contracts/MyContract.sol
+0 −0 test-profiles/build-info-v2/src/.gitkeep
+20 −0 test-profiles/build-info-v2/test/Upgrades.t.sol
+8 −0 test-profiles/build-info-v2/test/contracts/MyContract.sol
+113 −13 test/Upgrades.t.sol
+20 −28 test/UpgradesUseDefenderDeploy.t.sol
+40 −0 test/contracts/HasOwner.sol
+9 −0 test/contracts/Validations.sol
+66 −0 test/internal/Core.t.sol
+26 −31 test/internal/DefenderDeploy.t.sol
+56 −0 test/internal/StringFinder.t.sol
+18 −0 test/internal/StringHelper.sol
+5 −4 test/internal/Utils.t.sol
+1,051 −42 yarn.lock
78 changes: 78 additions & 0 deletions script/DeployMultiChain.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import "forge-std/Script.sol";
import "openzeppelin-foundry-upgrades/Upgrades.sol";
import {FishcakeEventManagerMultiChain} from "../src/contracts/core/FishcakeEventManagerMultiChain.sol";

contract DeployMultiChain is Script {
// USDT addresses on different chains
address constant BSC_USDT = 0x55d398326f99059fF775485246999027B3197955;
address constant POLYGON_USDT = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F;
address constant ARBITRUM_USDT = 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9;
address constant OPTIMISM_USDT = 0x94b008aA00579c1307B0EF2c499aD98a8ce58e58;
address constant BASE_USDT = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913;
address constant ETH_USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;

// Testnet USDT addresses
address constant BSC_TESTNET_USDT = 0x337610d27c682E347C9cD60BD4b3b107C9d34dDd;
address constant SEPOLIA_USDT = 0x7169D38820dfd117C3FA1f22a697dBA58d90BA06;

function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address deployer = vm.addr(deployerPrivateKey);

console.log("==== Fishcake Multi-Chain Deployment ====");
console.log("Deployer:", deployer);
console.log("Chain ID:", block.chainid);

// Get USDT address for current chain
address usdtAddress = getUSDTAddress(block.chainid);
require(usdtAddress != address(0), "USDT address not found for this chain");

console.log("USDT address:", usdtAddress);

vm.startBroadcast(deployerPrivateKey);

// Deploy proxy
address proxy = Upgrades.deployTransparentProxy(
"FishcakeEventManagerMultiChain.sol",
deployer,
abi.encodeCall(
FishcakeEventManagerMultiChain.initialize,
(deployer, usdtAddress)
)
);

console.log("\n=== Deployment Successful ===");
console.log("Proxy Address:", proxy);

// Get implementation address
bytes32 implSlot = vm.load(proxy, bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
address implementation = address(uint160(uint256(implSlot)));
console.log("Implementation:", implementation);

vm.stopBroadcast();

console.log("\n=== Next Steps ===");
console.log("1. Verify contract:");
console.log(" forge verify-contract", implementation, "FishcakeEventManagerMultiChain --chain-id", block.chainid);
console.log("2. Interact with proxy at:", proxy);
}

function getUSDTAddress(uint256 chainId) internal pure returns (address) {
// Mainnets
if (chainId == 56) return BSC_USDT; // BSC
if (chainId == 137) return POLYGON_USDT; // Polygon
if (chainId == 42161) return ARBITRUM_USDT; // Arbitrum
if (chainId == 10) return OPTIMISM_USDT; // Optimism
if (chainId == 8453) return BASE_USDT; // Base
if (chainId == 1) return ETH_USDT; // Ethereum

// Testnets
if (chainId == 97) return BSC_TESTNET_USDT; // BSC Testnet
if (chainId == 11155111) return SEPOLIA_USDT; // Sepolia

return address(0);
}
}
Loading