-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Implement Djed Tefnut protocol with ETH backing (Team Qwerty | Unstoppable Hackathon) #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
keshaviscool
wants to merge
4
commits into
DjedAlliance:main
Choose a base branch
from
keshaviscool:feature/djed-tefnut-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5ea9bcc
feat: Implement Djed Tefnut protocol with ETH backing
98b1523
fix: add proper if/else chain and error handling in DeploymentParameters
0f36c7c
fix: use correct IOracleShu interface for mainnet Tefnut deployment
64f4beb
refactor: add explicit safeguards against DJED_TEFNUT misuse in getCo…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "lib/contracts": { | ||
| "rev": "72073d0e2cabf7966b493fc77291e4891c5402d7" | ||
| }, | ||
| "lib/forge-std": { | ||
| "rev": "f73c73d2018eb6a111f35e4dae7b4f27401e9421" | ||
| }, | ||
| "lib/hebeswap-contract": { | ||
| "rev": "fb606bdcf5ddaee985039605bcd847918a66c3a7" | ||
| }, | ||
| "lib/openzeppelin-contracts": { | ||
| "rev": "0457042d93d9dfd760dbaa06a4d2f1216fdbe297" | ||
| }, | ||
| "lib/solmate": { | ||
| "rev": "3998897acb502fa7b480f505138a6ae1842e8d10" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity 0.8.19; | ||
|
|
||
| import "forge-std/Script.sol"; | ||
| import "../src/DjedTefnut.sol"; | ||
| import "./DeploymentParameters.sol"; | ||
|
|
||
| contract DeployDjedTefnutContract is Script, DeploymentParameters { | ||
| function run() external { | ||
| uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
|
|
||
| // Get configuration for Tefnut deployment | ||
| ( | ||
| address oracleAddress, | ||
| address treasuryAddress, | ||
| uint256 scalingFactor, | ||
| uint256 treasuryFeeFixed, | ||
| uint256 fee, | ||
| uint256 thresholdSupplySC, | ||
| uint256 rcMinPrice, | ||
| uint256 rcInitialPrice, | ||
| uint256 txLimit | ||
| ) = getTefnutConfigFromNetwork( | ||
| SupportedNetworks.ETHEREUM_CLASSIC_MORDOR // Change network as needed | ||
| ); | ||
|
|
||
| console.log("Deploying DjedTefnut with following parameters:"); | ||
| console.log("Oracle Address:", oracleAddress); | ||
| console.log("Treasury Address:", treasuryAddress); | ||
| console.log("Scaling Factor:", scalingFactor); | ||
| console.log("Treasury Fee (Fixed):", treasuryFeeFixed); | ||
| console.log("Protocol Fee:", fee); | ||
| console.log("Threshold Supply SC:", thresholdSupplySC); | ||
| console.log("RC Minimum Price:", rcMinPrice); | ||
| console.log("RC Initial Price:", rcInitialPrice); | ||
| console.log("Transaction Limit:", txLimit); | ||
|
|
||
| vm.startBroadcast(deployerPrivateKey); | ||
|
|
||
| // Deploy DjedTefnut with initial reserve | ||
| DjedTefnut djed = new DjedTefnut{value: 1 ether}( | ||
| oracleAddress, | ||
| scalingFactor, | ||
| treasuryAddress, | ||
| treasuryFeeFixed, | ||
| fee, | ||
| thresholdSupplySC, | ||
| rcMinPrice, | ||
| rcInitialPrice, | ||
| txLimit | ||
| ); | ||
|
|
||
| console.log("\n=== Deployment Successful ==="); | ||
| console.log("DjedTefnut Contract:", address(djed)); | ||
| console.log("StableCoin (SC):", address(djed.stableCoin())); | ||
| console.log("ReserveCoin (RC):", address(djed.reserveCoin())); | ||
| console.log("Initial Reserve:", address(djed).balance); | ||
|
|
||
| vm.stopBroadcast(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.