-
Notifications
You must be signed in to change notification settings - Fork 8
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
RefactoredMultiSwap #10
Conversation
salmanferrum
commented
Dec 5, 2022
- Refactored the FiberEngine to handle only Swap Functionality
- Refactored the FiberEngine codebase to use Network Configurations
- All Contract Initialisation or Configurations are moved to Networks.js
- All Contract Addresses or Token Addresses are initialised and Configured in Networks.js
- We have further created a Network specific configuration such as if we have GoerliETH: 5 then we have created a subclass configuration with 5 as a key and configurations (such as FundManager address, token addresses, fibeRouter address etc) as K-V Pairs)
- Refactored FiberEngine is mature enough to take these five parameters to swap around any blockchains:
- SourceNetwork ChainID
- SourceToken Address
- TargetNetwork ChainID
- TargetToken Address
- Amount
- Based on the ChainID, our FiberEngine is mature enough to pick all relevant configurations of specific Blockchain from Networks.js and process the Swap.
- USDC is set as Default Foundry Token to perform all swaps from & to FundManager
// IERC20Upgradeable(token).safeTransfer(_feeDistributor, fee); | ||
// IGeneralTaxDistributor(_feeDistributor).distributeTax(token); | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see fee is removed here, is it managed somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, in this PR - we are not doing any fee distribution so I've commented this part. Once we launch a basic MVP then we will work on fee module as well. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const bscRouter = "0xD99D1c33F9fC3444f8101754aBC46c52416550D1"; | ||
const goerliRouter = "0xEfF92A263d31888d860bD50809A8D171709b7b1c"; | ||
|
||
// FoundryToken | ||
const bscUsdt = "0xD069d62C372504d7fc5f3194E3fB989EF943d084"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salmanferrum what is the purpose of having assets like USDT and cake here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea to ensure these are the allowed tokens on the FIBER Engine side? @salmanferrum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, these are just the token addresses that we can use as the refinery/ionic tokens while performing the swaps.
Currently, USDc is the default foundry. However, cudos & USDT are also foundry assets.
Regarding, cake or other tokens - since we need to perform test swaps, we can import goerliCake and BScCake as Refinery asset in our swap script call as source/target token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining @salmanferrum.
Once you make the changes you mentioned in Slack, let me know, and I'll approve and merge this PR.
However, let's connect with @zikriya tomorrow on this item, I have discussed a flow of handling asset types that I think might conflict here.
@MaiwandSultan if you could assist with organizing this call. Thank you.
This reverts commit c734a0d. refactoredMultiSwap