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

Sway Farm try-hard mode: A cross-chain experience. #62

Open
cold-briu opened this issue Apr 13, 2024 · 0 comments
Open

Sway Farm try-hard mode: A cross-chain experience. #62

cold-briu opened this issue Apr 13, 2024 · 0 comments

Comments

@cold-briu
Copy link

Sway Farm try-hard mode: A cross-chain experience.

This proposal comes to facilitate the onboarding of Solidity developers into the Fuel ecosystem by implementing a fullstack application that showcases a complete user flow between Ethereum and Sway contracts.

In this case, a seamless Bridging and Withdrawal experience can be achieved with the Sway Farm try-hard mode (name TBD) that consist of the following elements.

  • Narrative in the context of SwayFarm that justifies the interaction between Ethereum and Fuel
  • Front End that interacts with the Fuel Canonical Bridge and SwayFarm Smart Contract.
  • Back end that evaluates and spends Predicates after plot pay off.
  • Upgradeable implementation of the SwayFarm contract to ensure back compatibility in the context of the Fuel Testnet.
  • Indexer implementation to showcase the data visualization of Fuel Smart Contracts.
  • Sway script implementation that showcase complex interactions with Fuel Smart Contracts.
  • Predicate implementation that showcase native account abstraction in the form of CDPs.

Narrative

In order to participate in the solarpunk economy of SwayFarm, users have to acquire plots by lending money from the Swayfarm City Hall through mortgages. These mortgages require users to deposit Ether as principal and collateral to be locked in predicates as CDPs. In case of defaulting, SwayFarm City Hall is entitled to retake ownership over the plot plus an interest from the collateralized Ether

The user is required to work the land in order to generate some SwayFarmToken that pays off the plot debt. The generated tokens are meant to be deposited in the mortgage predicate in order to fully unlock the plot.

Front end

  • Plot acquisition: A screen that involves Bridging, Withdrawing and CDP creation
  • Plot dashboard: A screen that tracks plot performance and predicate balance

Backend

  • CDP liquidation: a service that evaluates Predicates to unlock users ether after plot payoff.

Upgradeable implementation

  • SwayFarm legacy: Tracks state of SwayFarm normie mode
  • Proxy: Tracks Swarfarm try-hard mode implementations
  • SwayFarmToken: Tracks ownership of crop harvesting rewards
  • Game Engine: Tracks plots, players and crops.
  • CityHall: Collects interests from mortgages and buys players harvests.

Indexer

  • Indexing module that tracks GameEngine contract and user's Predicates.

Script

  • Sway script that handles interactions between contracts such as CDP creation and harvest selling.

Predicate

  • CDP design that locks user ether with a configurable payoff amount in order to unlock.

Interactions

  • User bridges ether
  • User request CDP by interacting with LenderScript
  • LenderScript deposits Ether intro predicate, request mints plot from CityHall and transfers plot to User
  • User Harvest from SwayFarm engine and sell to CityHall
  • User interacts with CDP Liquidation service to deposit SwayFarmToken into predicate and unlock ether.

This is a work in progress, comments are more than welcome.

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

No branches or pull requests

1 participant