Robert Zaremba
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # ReFi DeFi Mash ## Narrative - dedollarization - we need real world assets - environmental assets (link / screenshot of sources -> rating agencies, big4 ...) - https://cointelegraph.com/news/de-dollarization-is-it-really-happening - however, we still need stable assets to execute daily operations - DeFi surges 444% after SEC-CEX troubles: https://cointelegraph.com/news/defi-volumes-surge-after-binance-coinbase-lawsuits-finance-redefined - now is the time for ReFi ## Flow Alice, based in New York, decided to buy Ecological assets for $120k, which will be used to impact investment of new New York Green City Project: - `SCC`: Sky Scrapper Cow - bring farms to the top of NYC sky scrappers. - `MilkyWay` - new fresh water river in NYC. - `FucSEC` - project related alternative means of payment. She wants to keep them as a long term investment. However, she doesn't want to lock the value. Lending systems allow to take long positions and unlock the value. Alice enters the `ReFiUmee` system, which has the `ReFi Leverage` lending pool and integrates with the vast Gho Aave inter-chain facilitator. She supplies and collaterizes the ReFi tokens at `ReFiUmee`. Then she leverages her position and borrows `100k Gho`. Aave inter-chain facilitator validates the request from the `ReFiUmee` using Axelar bridge, and mints `Gho` to Alice in the Optimism layer-2. In the meantime a new bull market started. She used `50k` of liquid `Gho` to purchase optimistic, shit NFTs. Optimism is the new them of the bull run and she managed to sell them for `300k` making `250k`. The whole `ReFi Leverage` module is designed to get Gho and leverage ReFi assets. The fees are extreamly low, because she borrows from the system, rather than another liquidity provider. The fee is used only to compensate the risk, and will depend on the market conditions and system performance. At the beginning the fee is set to 1% / year. 3 years later, Alice decides to close her position. Her collateral is worth now `$200k`, the interest she had to pay is `100k (1.01**3 - 1) = 3.03k`. In summary, she was able to keep her long position with ecological assets: initial purchase of `120k` worth of `SCC, MilkyWay` and `Fuc*SEC` , she was able to use `100k` liquid `Gho`. At the end she has `250k - 100k - 3.03k = 146.07k Gho` and liquid (uncollaterized) `A, B, C` eco credits. Soon after that the market wants to celebrate the success of the _New York Green City Project_ and provides a way to bundle the ReFi tokens into an immortal _optimistic green_ NFT. Her NFT is worth `400k`. The Green City project has just been completed, and now she enjoys her city even more, breathing a fresh air :smiley: ## Aave ### Facilitator FACIL contract spec ```solidity //uint256 _mint_limit = 1_000_000; //uint256 _minted = 0; address _gho; address _aave_gov; function on_axelar_gmp(account addres, amount uint256) onlyBridge { // check if we don't pass the mint_limit -- _gho.mint() does validation logic too, do we need it here? // call _gho.mint to the address and amount _gho.mint(address, amount); } function update_mint_limit(uint256 mint_limit) onlyBridge { assert msg.sender == _aave_gov; // sets _mint_limit = mint_limit; // does not validate the new value (eg if !=0) _gho.setFacilitatorBucketCapacity(address(this), mint_limit); } // I think we don't need it because the contract itself is facilitator function add_faciliator(uint mint_limit, string label) { _gho.addFacilitator(address(this), label, mint_limit); } } ``` ### Aave GhoToken GHO contract: - FACILITATOR_MANAGER = contract above ? - BUCKET_MANAGER = contract above How to call: 1. deploy GhoToken gho & set an address we control to admin 2. call from admin gho.grantRole(FACILITATOR_MANAGER_ROLE, FACIL), or whichever account we set 3. call from admin gho.grantRole(BUCKET_MANAGER, FACIL), or whichever account we set 4. call from FACILITATOR_MANAGER_ROLE gho.addFacilitator(FACIL, label, mint_limit) => FACIL.add_faciliator() 5. now gho.mint() is only successful from our FACIL contract :) 6. to change mint_limit: call from BUCKET_MANAGER gho.setFacilitatorBucketCapacity(new_limit) => FACIL.update_mint_limit() code: https://github.com/ReFi-DeFi-hack-ethprague-2023/gho-refi-faciliator/blob/e9804c1526e47bd52a2f711ca15d758023a78d49/src/contracts/gho/GhoToken.sol currently deployed on optimism testnet : 0x83eCdb25F2E678baEEEBC814D35Fa7528A676792 ### Burn 1. User approves facilitator for burn amount 2. User calls burn(): a. Facilitator transferFrom Gho from user to itself b. send burn message over Axelar birdge This way the burn happens in one atomic transaction. ## Axelar bridge - Send message from native chain to evm (optimism chain) - GMP: specify `destination_chain`: "optimism", `destination_address` (contract address) and `message` - Send above message using ibc to axelar testnet address `axelar1dv4u5k73pzqrxlzujxg3qp8kvc3pje7jtdvu72npnt5zhq05ejcsn5qme5s` - We will need to run relayer from refi chain to axelar testnet chain - https://docs.axelar.dev/dev/general-message-passing/cosmos-gmp#messages-from-native-cosmos - Test tx: https://testnet.axelarscan.io/gmp/search - https://testnet.axelarscan.io/gmp/D0809072D2F1F3AFF74CA8E9C61091082EF8F7027CC88149497920AD08B3456D - Payload for call ``` Enocde the payload in Solidity and call the Axelar gateway. Axelar will build the CosmWasm contract call from the ABI-encoded payload uint32 version = 1; string[] memory dynamicParamArray = new string[](1); dynamicParamArray[0] = "greeting"; string[] memory dynamicTypeArray = new string[](1); dynamicTypeArray[0] = "string"; bytes memory payload = abi.encodePacked( bytes4(version), abi.encode( "hello_world", dynamicParamArray, dynamicTypeArray, abi.encode("hello!") ) ); ```` ## ReFi Assets * NCT (nature carbon tonne) / toucan * Green City * moss.earth * flowcarbon (dunno if live? ) *

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully