Skip to content
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

Merged
merged 8 commits into from
Dec 9, 2022
Merged

RefactoredMultiSwap #10

merged 8 commits into from
Dec 9, 2022

Conversation

salmanferrum
Copy link
Contributor

  • 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);
// }
// }
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Copy link
Contributor

@jpine3528 jpine3528 left a 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";
Copy link
Member

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?

Copy link
Member

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

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.

Copy link
Member

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.

@taha-abbasi taha-abbasi merged commit 2e99520 into ferrumnet:develop Dec 9, 2022
zikriya pushed a commit that referenced this pull request Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants