SpartanDev:07/06/21–13/06/21

DAppV2 — Dao Proposals | CreatePool | CreateSynth

Summary

If you havn’t already, it might be worth your time to check out the test net version of the DApp to see whats to come for the updated ProtocolV2.

SpartanProtocol.org

docs.SpartanProtocol.org

This will be an ongoing focus for the wider community to contribute towards.

Spartan Socials

Spartan Socials — Twitter

Top Impressions:

Top Engagement:

Top Community Mention:

SpartanSocials — Medium

SpartanSocials — Telegram

Contributor’s Focus

Phase 1 — SPARTA V2 (Token) — Completed!

Phase 2 — Spartan Protocol V2 (Protocol) — In Progress

SPARTA V2 (Token)

  • ONGOING — Work with DEXs & aggregators to ensure the new SPARTA token address is added to their lists (1inch, PancakeSwap etc)
  • COMPLETED & ONGOING— Work with token-tracking information websites to ensure new token info is added and verified (BSCscan, CoinGecko, CoinMarketCap etc)

SpartanContracts

  • CONTRACTS READY; CAMPAIGN BEING ORGANISED— Put the contracts through a code review process on CodeArena
  • COMPLETED & ONGOING— Continue the code review process within the community

DAppV2

  • COMPLETED — Create DAO hub for proposal management (This was extended to a complete DAO instead of simple-DAO)
  • COMPLETED — Test bond process from start to finish via UI (propose bond allocation, vote it in, finalise it, and then proceed to bond assets and test the weight from that in the DAOVault, and other proposals)

Phase 3 — Deploy & Iterate (Dependent on CodeArena Completion)

  • Enable Bond allocations to replenish TVL into the V2 pools
  • Deploy Lending to testnet
  • March onwards with our original goals of building the decentralised, yield-generating, solo staking, leveraged synthetics and derivatives + lending protocol on Binance Smart Chain

GitHub Activity — SpartanContractsV2

contracts/Dao.sol

  • Added ‘startTime’ for a genesis timestamp of the proposal creation
  • Set proposalCount to 0 on constructor
  • withdraw() — no longer needs to loop all proposals to remove weight; just removes from the current open proposal
  • listBondAsset() — changed to external and removed the unrequired return
  • delistBondAsset() — changed to external and removed the unrequired return
  • checkProposal() — created to handle ‘open’ & ‘startTime’ mappings
  • checkProposal() — added at the start of all newProposal functions
  • voteProposal() — no longer requires any args, as only 1 proposal can be open at a time
  • removeVote() — no longer requires any args, as only 1 proposal can be open at a time
  • _finalise() — no longer requires any args, as only 1 proposal can be open at a time
  • cancelProposal() — this no longer requires any args, nor a new proposal to be made. It simple allows any caller to cancel a proposal if it hasn’t finalised successfully after 14 days
  • finaliseProposal() — no longer requires any args, as only 1 proposal can be open at a time
  • countVotes() — no longer requires any args, as only 1 proposal can be open at a time

contracts/DaoVault.sol

  • Add ‘depositTime’ mapping for a timestamp to calc the 24hrs (86400 seconds) lockup
  • withdraw() — check added for currentTime to be greater than depositTime + 86400 (24hr)

contracts/poolFactory.sol

  • curatedPoolCount() — added to ‘view’

contracts/synthVault.sol

  • Changed mintSynths() to mintSynth()

test/3_dao.js

test/4_SynthFarm.js

GitHub Activity — SpartanDAppV2

Workflow

  • Updated env

ABIs

src/components/AssetSelect/AssetSelect.js

src/components/Common/WrongNetwork.js

  • We should also add an info page for testnet in the DApp and/or GitBook to help onboard Testnet Spartans

src/components/DataManager/DataManager.js

src/components/Sidebar/Sidebar.js

  • This whole component needs a rebuild into something more simple at some point; maybe wait for MDBbootstrap to be integrated and for the old libs to be removed

src/components/Supply/Supply.js

src/locales/en/translation.json

src/routes.js

  • Changed DAO icon to colosseum icon

src/store/bond/actions.js

src/store/dao/actions.js

  • voteProposal() — proposalID arg removed
  • removeVote() — proposalID arg removed
  • cancelProposal() — oldProposalID & newProposalID args removed
  • finaliseProposal() — proposalID arg removed

src/store/pool/actions.js

  • createPoolADD() — added action to create a new pool. Whoever calls this must add 10,000 SPARTA liquidity at the same time (to resist spam-pools)
  • The caller of the above will also be paying for the deploy gas costs (only ~0.015BNB at time of test)

src/store/synth/actions.js

  • The caller of the above will also be paying for the deploy gas costs (only ~0.015BNB at time of test)

src/utils/web3.js

  • Added comments with commits to help track down ABIs on old deploys
  • Cleaned up unused code

src/utils/web3Utils.js

src/views/pages/Dao/NewProposal.js

  • Check network and handle accordingly if not testnet

src/views/pages/Dao/Overview.js

  • Added simple filter to show ‘current/open’, ‘completed’ and ‘failed’ proposals

src/views/pages/Dao/ProposalItem.js

  • getSecondsCooloff() — handle time left until proposal can be finalised
  • status() — revamped to handle ‘successful’ & ‘failed’ & new [time, desc] format

src/views/pages/Home/NewPool.js

  • Validates address to make sure it's a BEP20 standard 18 decimal token. Also checks if it's in the TrustWallet repo and if so; retrieves the relevant token icon etc
  • Checks if the user’s SPARTA input is at least 10,000 units (requirement to create a pool)
  • Shows the ratio underneath in SPARTA, TOKEN and ~USD to ensure the user double/triple checks before adding liquidity

src/views/pages/Home/Overview.js

src/views/pages/PU/Overview.js

  • This will be a public dashboard that anyone can visit, however, it will not be linked in any menu
  • The idea is that the more advanced and integrated community members can perform any functions that normally an ‘admin’ would handle in a centralised project
  • This is a place for functions that are non-destructive for the protocol itself (that's what the DAO is for) but only dangerous for users who do not know what they are doing

src/views/pages/PU/EmptyPools.js

  • This is unlikely to ever be required, however a good opportunity to put in place the first of many edge-case user interface functions to ensure the community can manage all scenarios in the future

src/views/pages/Pools/LiqBond.js

  • If the count is 0; show a message about enabling a bond asset thru the DAO proposals

src/views/pages/Pools/Overview.js

src/views/pages/Swap/Swap.js

src/views/pages/Synths/NewSynth.js

  • This is a bit more simple than the NewPool component; the user is presented with a list of ‘curated’ pools that do not have a synth token yet deployed
  • The user can select a synth and choose to get it deployed straight away by paying the deploy gas fees

src/views/pages/Synths/Overview.js

  • Changed terminology from ‘burn’ to ‘melt’

src/views/pages/Synths/components/AssetSelect.js

src/views/pages/Vault/Components/DaoDepositModal.js

  • Lists all existing LPs that will be locked and also the new deposit
  • Modal handling moved to local scope instead of parent

src/views/pages/Vault/DaoVault.js

  • Show amount of time remaining until withdraw is unlocked for user
  • Disable withdraw button based on that check
  • Added in bond weight for the harvest calculation (bond weight is now included in DAO weight for proposals and harvest rewards)

src/views/pages/Vault/SynthVault.js

Project Information

Official Links

Community Contribution

Recently, community members have been graciously funnelling in to contribute to explainer articles, ideas and even $SPARTA donations to support the growth of the platform.

Engage with the community and contributors

Community Bounty Wallet

0x588f82a66eE31E59B88114836D11e3d00b3A7916

Incentivized liquidity and synthetic asset generation for Binance Smart Chain. https://SpartanProtocol.org