SpartanDev: 20SEP21 - 26SEP21

Dev Update

SpartanDev: 20SEP21 - 26SEP21

Public testnet is live & ready to go. Jump into the DApp and help with the final stage before mainnet v2!

SpartanDev: 20SEP21 - 26SEP21

Testnet is GO!!

Things are really starting to heat up in the land of $SPARTA with the public test net going live this week. Now is the time to jump into the shield wall and help try out the protocol on testnet.

Load up on some BSC Testnet Funds from the Faucet described below.

BSC Testnet Funds - The Faucet
The BSC testnet faucet is awaiting your claim Spartans! Go forward and dip into the sweet faucet in preparation for testnet.

Then, head over to the guide describing how to get involved and help the betterment of Spartan Protocol going forward. There are some instructions on how to report issues to GitHub so contributors can jump in and resolve them.

Reach out in the Telegram community chat to discuss your initial thoughts.

Helping With Testnet
Help contribute to the Spartan Protocol V2 public testnet. We all must help balance the pools and arb our way to glory!

Wednesday feeBurn Updateβ€Œ

Not Wednesday... but we do like this number very much!!

Spartan Socials - Twitterβ€Œ

Tweet of the Week:β€Œ

SpartanSocials - Mediumβ€Œ

SpartanSocials - Telegramβ€Œ


Contributor's Focus

CodeArena Contest

COMPLETED βœ… β€” Triage and prioritise the feedback submitted from the CodeArena wardens during the contest to prepare for the judges

COMPLETED βœ… β€” Work through the post-contest tasks with the C4 judges & team for the eventual allocation of awards to security wardens

COMPLETED βœ… β€” C4 Public Report

IN PROGRESS β€” Create & publish an article on the top issues

SPARTA V2 (Token)

COMPLETED βœ… β€” Work with DEXs & aggregators to ensure up-to-date information on the new SPARTA token (retiring the previous contract address)

COMPLETED βœ… β€” Work with token-tracking informational websites to ensure new token info is up-to-date (BSCscan, CoinGecko, CoinMarketCap)

SpartanContracts

COMPLETED βœ… β€” Sort and prioritise all CodeArena submissions into contract scopes along with tags based on β€˜actionable’ or β€˜discussion points’

COMPLETED βœ… β€” Implementing refinements to contracts to address C4 & contributor feedback since the C4 contest code-freeze

COMPLETED βœ… β€” Rebuild automated testing & commence private testnet

COMPLETED βœ… β€” Deploy V2 to public testnet

Deploy V2 to BSC mainnet

DAppV2

COMPLETED βœ… β€” Prepare DAppV2 for testnet deploy

COMPLETED βœ… β€” Continue updating during private testnet

IN PROGRESS - Continue updating during public testnet

After Mainnet

(Optional/Side-Task) β€” Work with aggregators to connect to the SPARTA pools

(Optional/Side-Task) β€” Work with CMC/CoinGecko to feed in the SPARTA pool info

Set up a reliable index of history scoped to contracts (use this for positions page etc)

Use the new testnet subgraph to build a more lightweight positions page for V2

Enable Bond allocations to replenish TVL into the V2 pools

March onwards with our original goals of building the decentralised, yield-generating synthetics protocol on Binance Smart Chain


β€ŒGitHub Activity β€” Spartan Contracts v2

Branch: PostC5

contracts/BondVault.sol

  1. Added: event Claimed(address indexed owner, address indexed poolAddress, uint amount); for better subgraph positions tracking
  2. Removed the unused bool return in depositForMember()
  3. Removed the unused bool return in claimForMember() & emit the new Claimed event
  4. Changed getMemberLPWeight() to use vault assets (curated pools) instead of bond-listed assets
  5. Moved burnBalance() back to the DAO
  6. Moved moveBASEBalance() back to the DAO
  7. Added requirement for the address handed to listBondAsset() to be curated
  8. Removed the unused bool return in claim() & added check to ensure only the DAO can call it direct (to prevent accidental unsynced proposal votes)

contracts/Dao.sol

  1. Changed some variables to private to save compile space
  2. Changed event DepositAsset to hand in poolAddr & tokenAddr for better subgraph positions management
  3. Added event Harvest(address indexed owner, uint amount); for better subgraph positions management
  4. Changed withdraw() args around other way
  5. Emit Harvest event in harvest()
  6. Moved back in the burnBalance() function
  7. Moved back in the moveBASEBalance() function
  8. Removed require(param > 0) from newParamProposal()
  9. Set retire to true on _moveDao()
  10. Added require(param > 0) in _changeCooloff()
  11. Added a retireDao() setter

contracts/Pool.sol

  1. Changed event AddLiquidity to hand in tokenAddr for better subgraph positions handling
  2. Changed event RemoveLiquidity to hand in tokenAddr for better subgraph positions handling
  3. Changed event BurnSynth to hand in synthAddr for better subgraph positions handling
  4. Changed event MintSynth to hand in synthAddr for better subgraph positions handling
  5. Changed removeForMember(address member) to removeForMember(address recipient, address actualMember) for better subgraph positions management
  6. Changed burnSynth(address member) to burnSynth(addressrecipient, addressactualMember) for better subgraph positions management

contracts/Router.sol

  1. Changed functions to suit any changed events elsewhere (see above)

contracts/Utils.sol

  1. Changed getPoolData() to return the pool's raw synthCap value (basis points) instead of handing back an amount in SPARTA

contracts/synthVault.sol

  1. Changed _deposit() to shift by 10 seconds instead of minimumDepositTime for better UX
  2. Changed harvestSingle() to shift by 10 seconds instead of minimumDepositTime for better UX

GitHub Activity β€” Spartan DApp v2

Readme.md

  1. Brought across the updated readme to the main branch

public/index.html

  1. Added & updated the favicons

src/ABI/TN/*.json

  1. Updated all the ABIs for public testnet

src/Providers.js

  1. Turned off non-critical warnings in ethers (combined ABIs in the txn parsing logic will be overloading the log if we keep that on)

src/components/Approval/Approval.js

  1. Changed some deps
  2. Changed the conditional compare to use BigNumber isLessThan()

src/components/AssetSelect/AssetSelect.js

  1. Added an optional prop to trigger an action on the parent component on click of the assetSelect box

src/components/DataManager/DataManager.js

  1. Added wallet.account as a dep for checkArraysNext() to ensure the token balances are updated as soon as the wallet connects instead of up to 7.5 seconds after

src/components/RecentTxns/RecentTxns.js

  1. Changed formatShortString() to only run if characters > 15
  2. If the user's wallet is the entity for a txn; show 'Your Wallet' instead of the wallet's address
  3. Added some wording to make the txn info more clear
  4. Added logic to handle what 'type' of asset it is and show the icon accordingly (Tokens, LPs, synths)
  5. Added an isLoading() check to ensure data isn't shown before its ready

src/components/WalletSelect/Assets.js

  1. Hide $USD if no internal pricing is available (prevent confusion on the current basic mainnet)
  2. Added an isLoading() check for conditionally showing data when it is ready

src/components/WalletSelect/LPs.js

  1. Moved getBondDetails() & getDaoDetails() to the parent component
  2. Simplified _getPool() as the fallback false is handled in the helper
  3. Added an isLoading() check for conditionally showing data when it is ready

src/components/WalletSelect/Synths.js

  1. Moved getSynthDetails() to the parent component
  2. Added an isLoading() check for conditionally showing data when it is ready

src/components/WalletSelect/WalletSelect.js

  1. Removed the isAppleDevice() logic seeing as Apple has blocked that TrustWallet feature
  2. Added an activeTab state
  3. Moved getBondDetails() & getDaoDetails() & getSynthDetails() here from the child components to manage the data getters from here instead of conditionally when the respective tab is selected. This data is helpful to this component so should be managed here instead
  4. Added a rankLoading() check to make sure the rank is not shown before the data is ready
  5. Made 'Loading' the fallback/default state of rank instead of 0 || Peasant
  6. On mainnet the rank will show as 'Wait for Mainnet' as there is no internal pricing available to use to calculate this yet (on the not-yet-launched mainnet v2)
  7. Added a getTokenCount() counter (with loading/spinner)
  8. Added a getLpsCount() counter (with loading/spinner)
  9. Added a getSynthsCount() counter (with loading/spinner)
  10. Changed 'assets' to 'tokens'
  11. Use state to handle selected tab instead of Tabs keys

src/store/bond/*.js

  1. Moved multi-line code to single-line where possible
  2. Added parseTxn() to the bond txn actions
  3. Changed the initialState to bool false for the objects

src/store/dao/*.js

  1. Converted all txns to the new parseTxn() style
  2. Changed the initialState to bool false for the objects

src/store/pool/*.js

  1. Added chainId handed into getTokenDetails() for the new getTwTokenLogo() logic
  2. Removed the old trustWalletIndex etc logic
  3. Changed synthCap to synthCapBPs to make it more clear it's in basis points
  4. Changed newPool to use genesis and oneWeek variable to calculate whether the pool is in newPool phase or not
  5. Added stirRate and lastStirred to the poolDetails object
  6. createPoolADD() rewritten to get everything in single lines & changed to the new Β parseTxn() logic
  7. Changed the initialState to bool false for the objects

src/store/reserve/*.js

  1. Changed the initialState to bool false for the objects

src/store/router/*.js

  1. Rewrote functions to get as many multi-line sections into single lines (code clarity)
  2. Converted all txns to the new parseTxn() style

src/store/sparta/*.js

  1. Rewrote functions to get as many multi-line sections into single lines (code clarity)
  2. Converted all txns to the new parseTxn() style
  3. Changed the initialState to bool false for the objects

src/store/synth/*.js

  1. Added getSynthMemberDetails() to get user's last deposit time
  2. Rewrote functions to get as many multi-line sections into single lines (code clarity)
  3. Converted all txns to the new parseTxn() style
  4. Changed the initialState to bool false for the objects

src/store/utils/*.js

  1. Changed the error output back to standard
  2. Pretty sure we can delete this entire store if we aren't going to use it for testing purposes. Otherwise, if we keep it, it could definitely at least do with a big cull; still a lot of functions in here from old contracts

src/store/web3/*.js

  1. Converted all txns to the new parseTxn() style

src/utils/math/router.js

  1. Updated stirCauldron() calculations:
  • Hardcoded 'week' changed to use the oneWeek variable in utils/web3
  • synthPoolSynthCap handed in changed to whole synthPool object
  • Get lastStirred & stirRate from the pool object instead of the synth object

2. mintSynth() - changed synthCapped logic to check using the synths (after fee) rather than synth amount before-fee

3. mintSynth() - added synthCapped to the returned array (was missing from out of the return scenarios)

4. burnSynth() - removed the extra feeBurn step (we were calculating-in one-too-many-burns)

src/utils/math/utils.js

  1. Added handleWBNB() to just do a simple check if the address is WBNB and change it to BNB if true (consistency)
  2. Changed getToken() & getPool() & getSynth() & getDao() & getBond() to all look for a match in the tokenAddress || address instead of just tokenAddress to make them a little bit more smart/helpful

src/utils/web3.js

  1. Updated addresses
  2. Added a oneWeek variable for easier management of variables changing
  3. Added getTwAssetId() to get the TrustWallet API formatted ID of an asset from it's tokenAddress
  4. Added getTwTokenInfo() to get the token's info from the TrustWallet index/repo
  5. Added getTwTokenLogo() to get the token's icon from the TrustWallet index/repo & fallback to our fallback icon if not available
  6. Added rough mergeAbis() function to help with handling event parsing for the RecentTxns component (merges multiple ABIs into one 'master' ABI)
  7. parseTxnLogs() - replaced any 'member' usage with txn.from so that the wallet that called the txn is used as the member instead of the member reported by the event (this works fine in the front end but is not possible in things like the subgraph)
  8. parseTxnLogs() - added manual parsing logic for all transaction types

src/views/pages/Bond/Bond.js

  1. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Bond/BondItem.js

  1. Added loading state when claiming a Bond position

src/views/pages/Dao/NewProposal.js

  1. Added loading state when submitting a new DAO proposal
  2. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Dao/Overview.js

  1. Added loading state when Dao items are not yet loaded

src/views/pages/Dao/ProposalItem.js

  1. Added loading states for each type of txn

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

  1. Added filter to ensure only curated assets are shown for Bond-listing

src/views/pages/Donate/Overview.js

  1. Added loading states for donation txns

src/views/pages/Home/NewPool.js

  1. Added loading states when creating a pool
  2. Use the new trustwallet icon-get logic instead of the old one (see above)
  3. OnClear & onSubmit the confirm checks will clear/reset

src/views/pages/Home/Overview.js

  1. Added badge counters to the home/pools page (for each type)
  2. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Home/PoolItem.js

  1. Added simple 'NEW', 'CURATED' & 'NORMAL' badges to the pool items (need someone to convert this into something more visually appealing)

src/views/pages/Home/SummaryItem.js

  1. Added simple explainers & badges for each pool type (need someone to convert this into something more visually appealing)

src/views/pages/Pools/LiqAdd.js

  1. Added loading states for all txn types
  2. Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
  3. Changed hardcoded 'week' to use the new oneWeek variable instead

src/views/pages/Pools/LiqBond.js

  1. Added loading states for all txn types
  2. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Pools/LiqRemove.js

  1. Added loading states for all txn types
  2. Changed hardcoded 'week' to use the new oneWeek variable instead

src/views/pages/Pools/Overview.js

  1. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Swap/Swap.js

  1. Added loading states for all txn types
  2. Changed hardcoded 'week' to use the new oneWeek variable instead
  3. Added dispatch to getSynthGlobalDetails()
  4. Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
  5. Added baseCapped & synthCapped returns for the checkValid() function

src/views/pages/Swap/SwapPair.js

  1. Added isLoading() logic to ensure data is only shown when it is ready

src/views/pages/Synths/NewSynth.js

  1. Added loading states for all txn types

src/views/pages/Synths/Overview.js

  1. Added loading states for all txn types
  2. Added dispatch to getSynthGlobalDetails()
  3. Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
  4. Added baseCapped & synthCapped returns for the checkValid() function

src/views/pages/Upgrade/Upgrade.js

  1. Added loading states for all txn types

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

  1. Added loading states for all txn types
  2. Added logic to clear the confirm checks whenever a significant change occurs
  3. Added checks and actions to handle whether a user should harvest before depositing

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

  1. Added loading states for all txn types
  2. Added logic to clear the confirm checks whenever a significant change occurs
  3. Added checks and actions to handle whether a user should harvest before depositing

src/views/pages/Vault/DaoVault.js

  1. Added loading states for all txn types
  2. Made the tile-heights static instead of dynamic to make the page a bit more balanced
  3. Refactored the 'item' logic into its own component (see next item)

src/views/pages/Vault/DaoVaultItem.js

  1. Created this child component to refactor the DaoVault code

src/views/pages/Vault/SynthVault.js

  1. Added loading states for all txn types
  2. Added dispatch for getSynthMemberDetails()
  3. Made the tile-heights static instead of dynamic to make the page a bit more balanced

src/views/pages/Vault/SynthVaultItem.js

  1. Added loading states for all txn types
  2. Made the tile-heights static instead of dynamic to make the page a bit more balanced

Project Information

  • Website: https://spartanprotocol.org/
  • DApp: https://dapp.spartanprotocol.org/
  • GitBook (Docs): https://docs.spartanprotocol.org/
  • GitHub: https://github.com/spartan-protocol

Community Contribution

Spartan Protocol is at its core, a community-driven and led project. In this vein, the more contributors the better. There is a great opportunity for community members to contribute by making LP reward analysis tools, etc.

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.β€Œ

Binance Smart Chain TestNet Faucet

Contributors TestNet Wallet

Got some spare BSC TestNet assets? Please throw some to the contributors getting ready for testing! Or build up your testnet balances via the faucet to help contribute to balancing the pools in the upcoming testnet.

  • 0x3d2aCFafd10600896C90a325c31700B3E1E2D791

Engage with the community and contributors

Where to find out about all the latest updates or suggest improvements β€” get involved.