Welcome to the Gold-Backed Stablecoin Project, where we introduce a unique stablecoin backed by real, physical gold. Our approach involves creating a gold token that directly represents ownership of physical gold. Subsequently, these gold tokens are utilized to back our stablecoin, providing a robust and tangible foundation for the stability of the digital currency.
We start by creating a unique gold token that is directly backed by physical gold. Each token represents a claim to a portion of real gold stored securely.
These gold tokens are then utilized as collateral to back our stablecoin. The stablecoin's value is pegged to the value of the underlying gold, providing a stable and reliable digital currency.
To account for variations in the price of gold, our stablecoin maintains a dynamic backing ratio. The backing can range from 100% to 50%, depending on the fluctuations in the market price of gold. This adaptive approach ensures the stability of the stablecoin in various market conditions.
-
Gold-Backed Stability: Benefit from the stability of physical gold, providing a reliable foundation for the stablecoin.
-
Dynamic Backing Ratio: The stablecoin adjusts its backing ratio based on the market price of gold, ensuring adaptability to changing market conditions.
-
Transparency: All transactions and gold holdings are transparently recorded on the blockchain for public verification.
-
Decentralized Security: Built on a decentralized blockchain for enhanced security and trustless operation.
To start using our Gold-Backed Stablecoin, follow these simple steps:
-
Clone the repository:
git clone https://github.com/aboongm/constellation-stablecoin.git -
cd constellation-stablecoin -
Install dependencies:
yarn install -
Compile the smart contracts:
yarn hardhat compile -
To run the test:
yarn hardhat test -
Deploy the smart contracts:
6.a. Create your own .env file for using your own private key and infura api
yarn hardhat run ./script/deployCoinGold.ts --network sepolia
6.b. on .env, the deployed CoinGold address should be updated.
yarn hardhat run ./script/deployCoinDollar.ts --network sepolia
-
Implement Chainlink Automation:
7.a. Go to this website
https://automation.chain.link7.b. Connect to your
metamask wallet7.c. Select
Sepolia network7.d. Click
Register new Upkeep7.e. Select
custom logicand clicknext7.f. Get your CoinDollar address from .env and paste it on
Target contract addressinput field7.g. Fill the
Upkeep nameinput field with your chosen name7.h. Deposit LINK to your Upkeep. Select an amount that will satisfy multiple performances to start.(5 LINKs or more)
7.i. Click that
Register Upkeepbutton and confirm the transaction.Wait until your transaction has been confirmed on-chain.7.j. Click
View Upkeep -
To interact with the react frontend
(NOTE: generate abis and contract addresses from previous steps before starting the react frontend)
8.a. cd
ui-web8.b.
yarnto add the dependencies8.c. Create
.envfile in ui-web folder, and copy the token addresses from.envin hardhat root. Prefix the variable names withVITE_8.d.
yarn run devto start the ui.8.e. Go to a browser and open
http://localhost:5173/8.f. You should be seeing the details of CoinGold and CoinDollar.
8.g. To test
Transferfunctionality, use your signer private key with the token balances to sign in to your metamask wallet.8.h. Then transfer some token to any wallet address.