GithubHelp home page GithubHelp logo

ziutop / myc-lending Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mycelium-ethereum/myc-lending

0.0 0.0 0.0 16.95 MB

Home Page: https://myc-lending.vercel.app

License: MIT License

Shell 6.24% JavaScript 1.43% Python 1.05% Solidity 91.28%

myc-lending's Introduction

MYC-Lending

Test the Migration on Testnet

Set env vars

export RPC_URL=<RPC_URL>

export PRIVATE_KEY=<PRIVATE_KEY>

export ACCOUNT=<MAIN_TESTNET_EOA>

Deploy V1 contracts

./scripts/V2/deployV1ContractsTestnet.sh

Run the export commands given at the end of the script to set the env vars.

Example: export MYC=0xDBEb80f81e2534500841013335F2b4A57e1B3EF3 ; export esMYC=0x9E0e9A4Ad4c9a1B676EA432B15607FCb338D1CE9 ; export LMYC=0x695144da81C76337F8Aa3c5709887147744F7698 ; export WETH=0x2b434670049cA89A75946447510AEF8fAAda0EF8 ; export LMYC_V1_IMPL=0xA3884728314DdA89Cb314a9f68994570A16899a5

Start a new cycle

./scripts/V1/newCycle.sh # Let this script finish/exit so it reconfigures variables properly

Deposit some MYC

./scripts/V1/deposit.sh 1000000000000000000000

Run a few cycles to get some rewards

./scripts/V1/newCycle.sh && ./scripts/V1/newCycle.sh # Let this script finish/exit so it reconfigures variables properly

Print out user's staked amount, claimable ETH, etc.

./scripts/V1/getUserData.sh # Variables should be set

Print out general vault info

./scripts/V1/getCycleData.sh # Variables should be set

Run the migration process

./scripts/V2/migrationProcessTestnet.sh

Run the export commands given at the end of the script to set the env vars.

Check the values

./scripts/V2/valueChecker.sh

Migrate your address

cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY $LMYC "migrate(address)" $ACCOUNT

Print out user's staked amount, claimable ETH, etc. Claimable ETH should remain unchanged

./scripts/V1/getUserData.sh # Variables should be set

Claim ETH on V1 rewards

cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY $LMYC "claim(bool,bytes)" "false" ""

Print out the RewardTracker MYC staked (should be your migrated amount), and your MYC staked (should equal eachother)

./scripts/V2/getTrackerUserData.sh

Try to migrate again (should revert)

cast send --rpc-url $RPC_URL --private-key $PRIVATE_KEY $LMYC "migrate(address)" $ACCOUNT

Migration Process

  1. LentMyc.setPaused (https://arbiscan.io/address/0x9B225FF56C48671d4D04786De068Ed8b88b672d6).
    • Note that this is just a safety precaution.
  2. Call LentMycWithMigration.setInPausedTransferMode(true).
  3. Start a new cycle.
  4. Deploy LentMycWithMigration.
  5. Call LentMycWithMigration.initialize with args address(0), address(0), 0, 0, 0, 0, address(0).
  6. Deploy RewardTracker.
  7. Call RewardTracker.initialize (Args: address(0), "", "", [], address(0)).
  8. Deploy RewardDistributor.
  9. Call RewardDistributor.initialize (Args: address(0), address(0), address(0))
  10. Deploy ERC1967 (Constructor args: address(rewardTracker), "")
  11. Deploy ERC1967 (Constructor args: address(rewardDistributor), "")
  12. Call initialize on each of these with the following arguments:
    • RewardTracker: 0x3E2d84477631691cC49B75a41bAe7ca8e032E8ac, "Staked MYC", "sMYC", [MYC, esMYC], address(rewardDistributorProxy)
    • RewardDistributor: 0x3E2d84477631691cC49B75a41bAe7ca8e032E8ac, 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, address(rewardTrackerProxy)
  13. Call RewardTracker.setHandler(address(lentMycWithMigrationProxy), true);.
  14. Call RewardTracker.setInPrivateTransferMode(true);.
  15. Call RewardTracker.setInPrivateClaimingMode(true);.
  16. Call RewardTracker.setInPrivateStakingMode(true);.
  17. Upgrade LentMyc to LentMycWithMigration.
  18. Verify that all variables are correctly set.
  19. Verify
    • RewardDistributor.
    • RewardTracker.
    • LentMycWithMigration (and new proxy).
    • RewardTracker proxy.
    • RewardDistributor proxy.
  20. Call LentMycWithMigration.setDepositWithdrawPaused(true).
  21. Call LentMycWithMigration.setV2RewardTrackerAndMigrator(address(rewardTrackerProxy), address(permissionedMigrator)).
  22. Call RewardTracker.setDepositCap(100_000_000 * 1e18)
  23. Migrate accounts.
  24. If everything looks good, unpause LentMyc to allow people to claim and update balance (i.e. get MYC they they may have requested withdraw).

myc-lending's People

Contributors

calabashsquash avatar dospore avatar raymogg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.