SpartanDev:10/05/21–16/05/21

Summary

  • Upgrade existing v1 tokens to v2 (Mainnet & Testnet)
  • Claim your share of SPARTA allocated to users impacted by the LP drain (Mainnet & Testnet)
  • Interact with DAppV2 to help test the V2 contracts (Testnet)

Spartan Socials — Twitter

Top Impressions:

Top Engagement:

Top Community Mention:

SpartanSocials — Medium

SpartanSocials — Telegram

Contributor’s Focus

Phase 1 — SPARTA V2 (Token) — Completed!

Affected Users Snapshot

Deploy New $SPARTA V2 (Token)

Deploy Upgrade DApp

  • The above-weighted claims (from the snapshot) are plugged in for affected users to claim via the bridge dapp
  • Implement deflationary mechanisms (burn SPARTA on each transfer etc)

Phase 2 — Spartan Protocol V2 (Protocol)

SPARTA V2 (Token)

  • Work with the CEXs to ensure the SPARTA holders all have their tokens upgraded as easily as possible. One would expect the exchanges to handle this for them (Binance, BKEX, MXC etc)
  • Work with DEXs & aggregators to ensure the new SPARTA token address is added to their lists
  • Work with token-tracking information websites to ensure new token info is added and verified (BSCscan, CoinGecko, CoinMarketCap etc)

SpartanContracts

  • Continue updating V2 contracts to suit the changes to the base contract and get it finalised ready for the CodeArena bounty
  • Put the contracts through a code review process on CodeArena
  • Continue the code review process within the community

DAppV2

  • Update the DAppV2 to suit any changed contracts

Community Forum

  • Setup categories & get the community contributing good questions about DAO proposals & mechanics of AMMs so that they can be padded out into longer-form go-to guides to post in the channels

Phase 3 — Deploy & Iterate

  • Deploy Protocol V2 to mainnet
  • Enable Bond allocations to get TVL into the V2 pools
  • Deploy Lending to testnet
  • Continue ahead with the previous plans!

GitHub Activity — SpartanContractsV2

V2/RouterV2.sol

  • Replace old transferTo() function with transferFrom()

contracts/DaoV2.sol

  • Cull DAO right down to gradually move in functions as tests are built

contracts/FallenSpartans.sol

  • Add event — SpartanAllocated
  • Add event — SpartanClaimed
  • Remove totalToClaim / params; instead allocate specific amount via function
  • Added helper function to ‘getClaim’

contracts/Reserve.sol

  • Created simple reserve contract for interim (before V2 protocol)

contracts/Sparta.sol

  • Changed token name to: “Spartan Protocol Token V2”
  • Changed ERC-20 refs to BEP-20
  • Changed sFS -> savedSpartans
  • Remove currentEra param
  • Refactor onlyDao log: “Must be DAO” -> “!DAO” (to reduce contract size)
  • Drop secondsPerEra to test emissions (temporary)
  • decreaseAllowance() — add checks for whether allowance requires a decrease of that size; approval() goes after checks
  • _approve() — add check if approval is already at max (if so; approval-increase can be skipped)
  • transferFrom() — add check for allowance > amount
  • Refactor some require() error messages
  • _burn() — added check for balance > amount
  • saveFallenSpartans() — added arg for amount (call in the amount instead of hard-coding it into the contract) can only be called once
  • upgrade() — add comments

contracts/synthVault.sol

  • Refactor out the interfaces for imports

test/8_Base.js

  • Test deploying the contract
  • Test burn function
  • Test approvals / allowance
  • Test emissions
  • Test feeBurn
  • Test upgrade, mint and allocation to sFS

GitHub Activity — SpartanDAppV2

public/index.html

  • Updated meta tags for DApp — still need to update the public folders images in the manifest but most of the of & twitter tags seem to be final now

src/Providers.js

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Removed /dapp/ portion of the routes

src/components/Approval/Approval.js

  • Made approval button less tall and wide

src/components/AssetSelect/AssetSelect.js

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Added filter to not allow SPARTAv2 to show up in assetSelect (testnet pools are still using SPARTAv1 contract + mainnet has no pools)
  • Replaced negative margins for ‘position: absolute’ and ‘left: right: top: bottom:’ designators (negative margins don't seem to work properly in safari)
  • Added checks to ensure the app doesn't break if certain components load before the data is ready

src/components/Common/LanguageDropdown.js

  • Added every locale from the community google sheet translation (we will need the community to now pull together to help translate each phrase for all languages; a lot of the translations won't make sense as they were from before there was the context within the dapp)
  • Change icon to a relevant country flag (for community review; obviously flags don't = languages, but it’s fun and pretty to look at; open to ideas here)
  • Converted the dropDown component into a popOver component
  • Refactored each language item using .map()

src/components/Common/ThemeSwitcher.js

src/components/Common/WrongNetwork.js

src/components/DataManager/DataManager.js

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Refactor how the networks are handled in preparation for going live with the Upgrade DApp
  • Check and change the network whenever the local storage ‘network’ item changes
  • Update the listedTokens & curatedPools arrays every 10 seconds or if the network changes
  • Check SPARTA token price every 10 seconds
  • Update the tokenDetails & synthArray every 7.5 seconds or if the wallet or listedTokens change
  • Update the listedPools whenever tokenDetails changes
  • Update synthDetails & poolDetails whenever listedPools changes
  • Removed refs to old store actions that no longer exist

src/components/Header/Header.js

  • Remove commented-out code
  • Add in the ThemeSwitcher component

src/components/RecentTxns/RecentTxns.js

  • Cleaned up recentTxns component
  • Changed old refs to old store actions to the new ones

src/components/Share/SharePool.js

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Added checks to asset1 & asset2 for the same reason as above

src/components/Supply/Supply.js

  • Added fallenSpartans contract item
  • Added check for the selected network to handle hiding tokenomics on mainnet (until after new contracts)
  • Added function to getTotalSupply
  • Added function to getMarketCap
  • Added placeholder function to getCirculatingSupply (need to plug in the relevant removals from supply ie. Reserve etc after new testnet contracts are deployed)
  • Added selected network to supply popover

src/components/WalletSelect/WalletSelect.js

  • Changed all ‘mainnet’ and ‘testnet’ checks to use chainId instead
  • Reload window on wallet disconnect or network change (makes sense to clear all stores when a major change like ‘network’ or ‘wallet’ happens to ensure no crossover of front-facing information)

src/components/layout/Common.js

  • Remove /dapp/ from routes

src/i18n.js

  • Constructed the objects for every language/translation
  • Removed the hard-coded ‘en’ selector (detects browser settings for language first, if fails then ‘en’)
  • Will use the last setting you used within the dapp as a priority though

src/routes.js

  • Added ‘upgrade’ component to the routes
  • Made all nav icons smaller
  • Removed /dapp/ from all routes

src/store/pool/actions.js

  • Handle SPARTAv1 & SPARTAv2 differently in the poolArrays
  • SPARTAv1 will show up as SPARTA (old) and SPARTAv2 will show up as SPARTA

src/store/sparta/actions.js

  • Added genesis of fallenSpartans contract to the sparta store actions (to work out expiry())
  • Added upgrade() function to actions (Upgrade V1 SPARTA to V2)
  • Added claim() function to actions (Claim SPARTA from V1 LP-drain)
  • Added helper function to check the claim (claimCheck())
  • Removed old actions

src/utils/web3.js

  • Added fallenSpartans ABI & address
  • Added new base contract ABI & address
  • Commented out a problematic testnet RPC: ‘https://data-seed-prebsc-2-s3.binance.org:8545/'
  • Added in mainnet backup RPCs (but commented out)
  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Changed mainnet back to the default network

src/utils/web3Contracts.js

  • ‘addr’ was causing stale addresses on network change; removed it and call the function direct throughout this file
  • Added getTokenContract()
  • Added getFallenSpartansContract()

src/utils/web3Utils.js

  • Added calcBurnFee() function

src/views/pages/Bond/Bond.js && BondItem.js

  • Hide bond component if mainnet is selected
  • Inject the translations throughout the component

src/views/pages/Pools/Liquidity.js && all sub-components

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Hide liq components if network = mainnet
  • Handle ‘addr.spartav1’ throughout instead of ‘addr.sparta’
  • Inject translations throughout

src/views/pages/Swap/Swap.js && all sub-components

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Hide swap components if network = mainnet
  • Handle ‘addr.spartav1’ throughout instead of ‘addr.sparta’
  • Inject translations throughout

src/views/pages/Synths/Overview.js && all sub-components

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Hide synth components if network = mainnet
  • Handle ‘addr.spartav1’ throughout instead of ‘addr.sparta’
  • Inject translations throughout

src/views/pages/Upgrade/Overview.js && Upgrade.js

  • Created the ‘Upgrade DApp’ component
  • Allow users to upgrade their V1 SPARTA into V2 SPARTA
  • Allow users to check if they had LP affected by the v1 LP-Drain and make a claim if so

src/views/pages/Vault/Overview.js && all sub-components

  • Added tryParse() so that if a relevant localStorage item is missing, modified or corrupted; the app doesn’t break
  • Hide vault components if network = mainnet
  • Handle ‘addr.spartav1’ throughout instead of ‘addr.sparta’
  • Inject translations throughout

GitHub Activity — SpartanSite

dao.html

  • Content added to DAO page
  • Added GitBook link to footer

Project Information

Official Links

Community Contribution

Engage with the community and contributors

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

PokeMine

How to access AWS EC2?

Random number generator (RNG)

MetaFarmVerse - One of The Best Protocol in Metaverse World.

{UPDATE} Hanoi's Towers Hack Free Resources Generator

Cyber Deception — Peering Into the Past

{UPDATE} No.Paint - Coloring Games Hack Free Resources Generator

Top 25 RCE Bug Bounty Reports

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SpartanProtocol

SpartanProtocol

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

More from Medium

UPFI-3Pool Farming Pool— Stable swap guideline

The Leading-Edge Decentralized Protocol (Swap, Farm, Stake and earn) equipped with a Derivatives…

SOULLY found some FANGs: A Guide on How to Convert Spooky LP to Spirit LP