Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

Memecoins & Stablecoins Development

Please take a look at the attachment.

Lab #3: Blockchain-Based Ecosystems: Memecoins & Stablecoins Development, Attack Simulation, and Auditing

Lastname: ______________ First name:____________Date_______ TA_Prove_

Yes/No

1. Overview

This lab guides students through designing, implementing, deploying, testing, and auditing a simple memecoin (ERC‑20) and a minimal ecosystem around it (liquidity pool, simple governance, and a front-end). The lab emphasizes on hands‑on smart contract development, off‑chain assets, tampering/attack simulation, and understanding security tradeoffs.

Students will:

· Build a token

· Deploy it to a local testnet

· Create a Uniswap-style liquidity pair

· Implement simple governance

· Simulate common memecoin attacks like rug‑pull, unauthorized minting, honeypot

· Detect attacks and propose mitigations.

2. Lab Environment Setup

You will be running our code locally using Visual Studio Code to edit our code and using the terminal to run commands. I will reference the code using a file name as label or function name in cases where we have more than a function inside a file. Below are the tools we would be using

· Node.js v16+ and npm

· Hardhat local node (an Ethereum local chain)

· Ethers.js

· MetaMask (for manual UI testing) or a local script wallet

· Python 3.8+ for off‑chain helper scripts

3. Tasks (Lab Steps)

Part 1: Mime Coin

Task 0 – Environment & Setup

1. Would be using google colab run the project with link here

Screenshots/copies of compiled contracts and deployed addresses (token, router/pair, governance contract)

Task 1 – Create a basic ERC-20 memecoin

1. Implement Memecoin.sol (ERC‑20) with these features:

a. name, symbol, decimals.

b. initialSupply minted to deployer.

c. mint function restricted to onlyOwner.

d. burn function available to any holder.

e. setMaxWallet(uint256) (optional anti‑whale).

2. Deploy and record the token address and owner address.

Contract file, deployed address, transaction hashes, and a short explanation of tokenomics chosen

Task 2 – Add simple tokenomics and on‑chain rules

1. Add configurable transaction fee (tax) on transfers that routes to a treasury address.

2. Implement enableTrading() gating so token is non‑transferable until the owner opens trading (useful for launch control).

3. Add excludeFromFees(address) and isExcludedFromFees(address) logic.

Show expected token transfer behavior before and after enableTrading() and with fee exemptions

Code snippets, test results, and observations.

Task 3 – Provide liquidity & interact with an Automated Market Maker (AMM) integration

1. Using a Uniswap v2 fork or the provided simplified AMM, create a token–ETH pair and add liquidity programmatically from your deployer account

2. Show the token price after adding liquidity.

Script used to add liquidity, transaction hashes, and a screenshot of the pair state (reserves and price).

Task 4 – Attack simulations & tamper exercises

This mirrors the vulnerability and tamper simulations from Project 1 but adapted to tokens.

1.
Unauthorized Minting / Owner Key Leak simulation

a. Create a second (attacker) signer and simulate that signer calling mint() (if onlyOwner is removed or the owner key is compromised). Demonstrate supply inflation and its effect on price.

2.
Rug‑pull simulation

a. Owner adds liquidity and then withdraws all liquidity from the pool (or transfers treasury tokens and removes liquidity). Show how token price collapses and holders are stuck with worthless tokens.

3.
Honeypot / Transfer Revert

a. Introduce a buggy transfer logic that allows buys but prevents sells (simulate a honeypot). Demonstrate a transaction that fails on sell.

4.
Front‑end social engineering simulation

a. Show how a malicious UI could trick users to approve unlimited allowance or sign a permit that transfers tokens. Demonstrate by interacting with a script that calls approve(spender, type(uint256).max) and then transferFrom.

For each simulation:

· Run tests showing the exploit succeeds (or fails if protections exist).

· Recompute on‑chain states (supply, balances, reserves) and show the exact mismatch (before/after)

Scripts, test output, and explanation of the exploit.

Task 5 – Detection and mitigation of attack

· Write unit tests that assert invariants such as total supply cap, owner balance limits, and that enableTrading gating prevents transfers pre‑launch.

· Implement fixes: reintroduce onlyOwner on mint, add timelock for owner actions, add a renounceOwnership() demonstration and explain consequences.

Test suite results, fixed contract versions, and an audit summary

Part 2: Stable Coin: Students will build a simplified Collateralized Stablecoin

Task 0 – The Stablecoin Creation

Create the assets and the pricing mechanism.

1. StableCoin.sol: A standard ERC-20 (symbol: USDM) where mint and burn are restricted to the Vault contract.

2. MockOracle.sol: A simple contract that stores a variable ethPriceUSD.

Task 1 – The Vault (Minting & Redeeming)

Allow users to deposit ETH and borrow USDM against it.

1. Deposit/Mint:

a. User sends ETH.

b. Contract calculates USD value using MockOracle.

c. Checks if (ETH Value / Mint Amount) >= 1.5

d. Mints USDM to user.

2. Repay/Withdraw:

a. User approves and sends USDM back to Vault.

b. Vault burns USDM.

c. Vault returns equivalent ETH to user.

Calculate the Health Factor if the position is at risk of attack using ETH collateral amount * ETH Price / USDM Minted

Task 2 – Attack Simulation: The Death Spiral

Simulate what happens when the collateral asset crashes like the DeFi exploits.

1. Set Oracle price of ETH to $3000.

2. User A deposits 1 ETH ($3000 value) and mints 2000 USDM. (Ratio: 1.5).

3. The attacker (or market conditions) calls MockOracle.setPrice(1500).

4. User A’s collateral is now worth $1500, but they owe 2000 USDM. The system is under-collateralized.

5. User A decides never to repay the loan because keeping the 2000 USDM is more profitable than getting back $1500 of ETH. The protocol is now insolvent.

Include screenshot of each step

Task 3 – Detection & Mitigation of the Death Spial Attack

How the code of how you would detect this attack and mitigate the attack from happening

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Blockchain Presentation

presentation about a blockchain Term Project CIS 5730- Blockchain Application Project Guideline Part ii–Presentation Along with the project you will present what you did to the class in a short presentation. If you want, you can demonstrate the project, or just present an overview of what you did. Presentations should

Network Threats

  Questions: Below is a list of common network attacks: Distributed Denial of Service (DDoS) DNS poisoning ARP poisoning Domain hijacking MAC flooding MAC cloning Man-in-the-Middle Explain two of these network attacks and discuss methods/techniques for protecting the network against them.

Best Practices for Role-Based Privilege Management in Databases

  Research the best practices for managing and securing role-based privileges in databases and address the following questions in your discussion post:  What are the key challenges in managing role-based privileges, and how do they impact database security? Can you provide a real-world scenario where poor role-based privilege management led

Computer Science Cloud Computing assignment

Please see attachment for details 4 [ Note: To complete this template, replace the bracketed text with your own content. Remove this note before you submit your paper.] Cloud Computing Evaluation Paper 1 Cloud Computing [Differentiate between cloud computing models and their uses. What are the different types of deployment

Computer Science- Python Python Programming Assignment

Computer Science Python Programming Lab assignment help. Design a Python program that calculates a credit card customer’s minimum payment based on their balance. Please use If Else and elif statements in your code. You must add comments in your code. Please round the minimum payment to two decimal places using

Blockchain Application

I need help with my coursework project. Let me know if you need any help from me.  Lab 2: Blockchain-Based Academic Credentials Lab Lastname: ______________ Firstname:________________ 1. Overview AETHELRED UNIVERSITY Registrar’s Office wants to start issuing a digital transcripts and diploma for graduating students. You are called to build the

LOREM, IPSUM

The ability to develop a risk register is a skill needed by all cybersecurity leaders when assessing cybersecurity risks. A risk register provides a detailed listing of known risks as well as quantitative or qualitative assessments of those risks, resulting in the prioritization of action.

Virtual LANs

  Questions: A VLAN allows different devices to be connected virtually to each other as if they were in a LAN sharing a single broadcast domain. 1. Why a network engineer would want to deploy VLANs? 2. How do VLANs improve network security?

compliance and rules to follow in cybersecurity.

Follow the attached instructions to complete this work. Note: Make sure to follows rubric or aligns with Rubric. Unit 8 Assignment Directions: Case Study Review the following hypothetical case study. Consider the big-picture ideas and the specific concerns. Make use of the key terms and concepts from the readings in

Discussion on data ( computer science)

Follow the attached direction to complete this work Unit 7 Discussion   Overview Consider this scenario: PQR Corporation provides facial recognition technology to customers. Its products include customer access to consumer electronics as well as mass surveillance capabilities through networked camera systems. While operating legally, PQR has maintained a low

Computer Science – Machine Learning Python Programming Assignment

Assignment Help. Please don’t forget to add comments in the code Page 1 of 3 NorQuest College – CMPT 1011: Lab Assignment 5 CMPT 1011: Introduction to Computing Lab Assignment 2: Variables, mathematical operations and data types Value This coding challenge is worth 3% of your final grade. Background In

Public safety Communications

Subscribe The Communications and Cyber Resiliency Toolkit provides guidance for establishing resiliency measures, public safety communications can better withstand potential disruptions to service. This toolkit, developed by CISA, describes networks and systems critical to successful communication and cyber resiliency and possible threats while providing many resources and additional links for

Case Study 4 o Data (computer)

Follow the attached instructions to complete this work Unit 4 Case Study Directions Review the following case study. Consider both the big-picture ideas and the specific concerns. Make use of the key terms and concepts from the readings in your written responses to the questions below. The case study paper

Discussion 5 and 6

Follow  the attached instructions to complete this work Unit 5 Discussion   Overview In this discussion, you will be considering the emphasis on aspects such as privacy and safety. You will reflect on the significance of the legal concerns and goals of public-private partnerships to address cybersecurity. You will also

SQL injection

Hey! ????  I need an expert in SQL injection, DDOS attack, Code injection attack, XSS attack! To talk further please contact me on discord at mara411 so we can talk more freely and then I will hire you on here! Thanks ???? 

Free CAD, FeniCS or paraview

I have attached the picture and sample work too, I need work as like sampl, but not the copypasted Make sure you can ask me multiple questions but not dont do rubbish work

database

2. Final Assignment – equivalent to 4,000 words The final module mark is based on two deliverables focused on the CarNow case study described below. – 50% of the final mark a. An advisory report – 50 % of the final mark Includes 5% (of the module grade) given for