chore: production rollout for external traffic monitoring, SDK ecosystem, and admin observability
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 9s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 9s
This commit is contained in:
45
packages/smart-contracts/contracts/VibeToken.sol
Normal file
45
packages/smart-contracts/contracts/VibeToken.sol
Normal file
@@ -0,0 +1,45 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
import "@openzeppelin/contracts/access/Ownable.sol";
|
||||
|
||||
contract VibeToken is ERC20, Ownable {
|
||||
address public treasury;
|
||||
uint256 public taxRate = 5; // 5%
|
||||
|
||||
constructor(address _treasury) ERC20("VibeWork Agent Token", "VIBE") Ownable(msg.sender) {
|
||||
treasury = _treasury;
|
||||
_mint(msg.sender, 1_000_000_000 * 10 ** decimals()); // 1 Billion tokens
|
||||
}
|
||||
|
||||
function setTreasury(address _newTreasury) external onlyOwner {
|
||||
treasury = _newTreasury;
|
||||
}
|
||||
|
||||
function setTaxRate(uint256 _newRate) external onlyOwner {
|
||||
require(_newRate <= 20, "Tax too high"); // Max 20%
|
||||
taxRate = _newRate;
|
||||
}
|
||||
|
||||
// Override the core transfer logic to implement the Bot Extraction Tax
|
||||
function _update(address from, address to, uint256 value) internal virtual override {
|
||||
// Bypass tax for mints/burns and owner transfers (initial liquidity provision)
|
||||
if (from == address(0) || to == address(0) || from == owner() || to == owner() || taxRate == 0) {
|
||||
super._update(from, to, value);
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate tax
|
||||
uint256 taxAmount = (value * taxRate) / 100;
|
||||
uint256 sendAmount = value - taxAmount;
|
||||
|
||||
// Route tax directly to Treasury wallet
|
||||
if (taxAmount > 0) {
|
||||
super._update(from, treasury, taxAmount);
|
||||
}
|
||||
|
||||
// Send the rest to the recipient
|
||||
super._update(from, to, sendAmount);
|
||||
}
|
||||
}
|
||||
17
packages/smart-contracts/hardhat.config.ts
Normal file
17
packages/smart-contracts/hardhat.config.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { HardhatUserConfig } from "hardhat/config";
|
||||
import "@nomicfoundation/hardhat-toolbox";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config({ path: "../../apps/web/.env" }); // Load from root workspace web/.env
|
||||
|
||||
const config: HardhatUserConfig = {
|
||||
solidity: "0.8.20",
|
||||
networks: {
|
||||
base: {
|
||||
url: "https://mainnet.base.org",
|
||||
accounts: process.env.PLATFORM_TREASURY_PRIVATE_KEY ? [process.env.PLATFORM_TREASURY_PRIVATE_KEY] : []
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
17
packages/smart-contracts/package.json
Normal file
17
packages/smart-contracts/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@agent-bounty/smart-contracts",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"compile": "hardhat compile",
|
||||
"deploy:base": "hardhat run scripts/deploy_bot_trap.ts --network base"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
|
||||
"hardhat": "^2.19.0",
|
||||
"dotenv": "^16.4.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@openzeppelin/contracts": "^5.0.0"
|
||||
}
|
||||
}
|
||||
46
packages/smart-contracts/scripts/deploy_bot_trap.ts
Normal file
46
packages/smart-contracts/scripts/deploy_bot_trap.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { ethers } from "hardhat";
|
||||
|
||||
async function main() {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
|
||||
if (!deployer) {
|
||||
console.error("❌ No deployer account found. Have you set PLATFORM_TREASURY_PRIVATE_KEY in your .env?");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("=====================================");
|
||||
console.log("🎣 VibeWork Phase 18: Bot Honeypot");
|
||||
console.log("=====================================");
|
||||
console.log("Deploying from:", deployer.address);
|
||||
|
||||
const balance = await ethers.provider.getBalance(deployer.address);
|
||||
console.log("Balance:", ethers.formatEther(balance), "ETH");
|
||||
|
||||
if (balance === 0n) {
|
||||
console.error("❌ INSUFFICIENT FUNDS. You need a few dollars of Base ETH to deploy.");
|
||||
console.error("Please fund your Treasury wallet on Base Mainnet:", deployer.address);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("\n🚀 Deploying $VIBE Token (5% Tax to Treasury)...");
|
||||
|
||||
// The treasury is the deployer wallet itself
|
||||
const VibeToken = await ethers.getContractFactory("VibeToken");
|
||||
const token = await VibeToken.deploy(deployer.address);
|
||||
|
||||
await token.waitForDeployment();
|
||||
|
||||
const tokenAddress = await token.getAddress();
|
||||
console.log("\n✅ $VIBE Deployed Successfully!");
|
||||
console.log("📍 Contract Address:", tokenAddress);
|
||||
console.log("\nNEXT STEPS:");
|
||||
console.log("1. Go to Uniswap V3 on Base Mainnet.");
|
||||
console.log(`2. Create a new pool for ${tokenAddress} / WETH.`);
|
||||
console.log("3. Add ~$5 worth of ETH and your total supply of $VIBE.");
|
||||
console.log("4. Watch Sniper Bots immediately buy the token, while 5% of their purchase goes directly into your Treasury Wallet!");
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
14
packages/smart-contracts/tsconfig.json
Normal file
14
packages/smart-contracts/tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"ignoreDeprecations": "6.0"
|
||||
},
|
||||
"include": ["./scripts", "./test", "./hardhat.config.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user