SpartanDev: 12/07/21 – 18/07/21
Updates from mid-July 2021. First major testnet subgraph & CodeArena contest in full-swing.
Summary
This week in $SPARTA, we saw the activation of the long awaited @code423n4 smart contract audit competition.
Don’t forget that you can also take part in the audit process and be rewarded for your efforts.
Take the time to click through to their Twitter post below to see the great animation they came up with, it has been pretty damn popular on the socials.
The audit should wrap up mid this week. Following the conclusion, the contributors will work closely with the C4 team, judges and wardens to resolve any issues, if found.
The community will be kept in the loop and updated as soon as the next steps have been resolved and are able to be public.
Thankyou for the unwavering support that has come forward from the shield wall.
Its time to upgrade your tokens
No problems; upgrade today
You can use the Spartan Protocol Upgrade DApp to upgrade your SPARTAv1 tokens to SPARTAv2 yourself.
Upgrade DApp — https://dapp.spartanprotocol.org/upgrade
Bit-Rush Crypto has created a video guide on using the SpartanProtocol Upgrade DApp — timestamp 3:20. Nice work SPARTANS!!
feeBurn Update
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)
- COMPLETED & ONGOING — Work with the centralised exchanges (CEX) listing SPARTA to ensure that SPARTA holders all have their tokens upgraded as simply as possible. It is expected that CEX holders will not need to perform any specific actions to have their tokens exchanged for V2 tokens (Binance, BKEX, MXC etc)
- ONGOING — Work with DEXs & aggregators to ensure the new SPARTA token address is added to their lists as the primary address for SPARTA (retiring the previous contract address) (1inch, PancakeSwap etc)
- COMPLETED & ONGOING — Work with token-tracking informational websites to ensure new token info is added and verified (BSCscan, CoinGecko, CoinMarketCap etc)
SpartanContracts
- COMPLETED & ONGOING — Continued updating and stringent testing of V2 contracts to suit the changes made against the base token contract, and ensure the V2 contract suite is in a complete and stable position ready for a CodeArena community review and bounty period
- BOOKED: 15/07/2021 — Put the contracts through a code review process on CodeArena.
- COMPLETED & ONGOING — Continue the code review process within the community
DAppV2
- COMPLETED — Update the V2 DApp to suit any required contract changes/upgrades
- 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)
- COMPLETED — Rip out all the old libraries and rebuild using one component library; refactor and cleanup style sheets as we go to reduce the overall project size ready for larger-scale community contribution on mainnet
- COMPLETED — Add a calculable APY figure to the SynthVault
- COMPLETED & ONGOING — Set up a reliable index of history scoped to contracts (use this for positions page etc)
- IN PROGRESS — Use the new testnet subgraph to build a more lightweight positions page for V2
Phase 3 — Deploy & Iterate (Dependent on CodeArena Completion)
- Assess codeArena audit feedback and make changes where required
- Deploy Protocol V2 to Binance Smart Chain mainnet
- 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 — SpartanSubgraph
- Setup initial subgraph to simply track the PoolFactory being deployed and pool contracts as they are individually deployed
- Add in handlers for addLiquidity events along with all relevant entites (pools, members, tokens, addLiq, removeLiq, swap etc)
- Finetune the addLiquidity handler then duplicated and fine tune for the rest
- Add in derived-SPARTA and derived-USD values using the pools internal pricing (dont forget the AMM essentially has a fun side-effect of being a decentralised oracle)
- Derived-USD uses an average of the SPARTA:TOKEN ratios of all stablecoins listed; in testnet this is DAI and BUSD; on mainnet all existing big stablecoins will be enabled so that when/if they are listed they will be utilized straight away.
- This testnet subgraph is live and query-able if you would like to check it out: https://thegraph.com/legacy-explorer/subgraph/spartan-protocol/pool-factory
- MintSynth / BurnSynth events are not yet complete but all other internal pool functions are; so positions can reliably make a start in DAppV2 now
GitHub Activity — SpartanContractsV2
RebuildSparta Branch
contracts/BondVault.sol
- Added bondRelease variable to allow earlier release of bond allocations in the event of something like a migration (as previously used in v1)
contracts/Router.sol
This router was initially designed to not allow deflationary tokens to be listed to save gas (calling a balance is much more expensive in gas than using the existing local variable)
The pools contracts themselves handle deflationary assets (like ours; feeBurn) properly already so a decision like this is fine to make on a 2nd layer contract that can easily be upgraded by the DAO later on.
However a decision has been made to save any delay/confusion later on down the track. The router has been modified to call balances of TOKEN instead of using the local mapping/variable (same way SPARTA is handled)
Most functions were gas optimized at the same time anyway so the negatives shouldn't outweigh the previous positives in the scope of ‘gas’
- addLiquidity() — removed the return (not required; save gas)
- addLiquidityForMember() — removed the return (not required; save gas)
- zapLiquidity() — removed the return (not required; save gas)
- zapLiquidity() — call token balance to get ‘received’ instead of ‘sent’ to support feeBurn-style tokens (see above)
- addLiquiditySingle() — removed the return (not required; save gas)
- addLiquiditySingleForMember() — removed the return (not required; save gas)
- removeLiquidity() — removed the return (not required; save gas)
- removeLiquidityExact() — removed the return (not required; save gas)
- removeLiquidityExact() — call token balance to get ‘received’ instead of ‘sent’ to support feeBurn-style tokens (see above)
- removeLiquiditySingle() — removed the return (not required; save gas)
- removeLiquiditySingle() — call token balance to get ‘received’ instead of ‘sent’ to support feeBurn-style tokens (see above)
- buyTo() — removed the return (not required; save gas)
- buyTo() — if not swapped to BNB; tsf directly from pool to user instead of routing thru router to save gas
- swapAssetToSynth() — removed the return (not required; save gas)
- swapSynthToAsset() — removed the return (not required; save gas)
- swapSynthToAsset() — if not swapped to BNB; tsf directly from pool to user instead of routing thru router to save gas
EventsChanges Branch
contracts/Pool.sol
- events: MintSynth && BurnSynth — adjusted to hand out relevant values for subgraph (to track pool’s totalSupply change and any change in SPARTA held by the pool)
contracts/Synth.sol
- burnSynth() — changed retun from bool to uint. Return the amount of LP units that are burnt in the process (for the above-changed BurnSynth event)
contracts/poolFactory.sol
- event: CreatePool — moved the emit above the liqAdd function in createPoolADD() so that the subgraph handles creating the pool before handling adding the liquidity
GitHub Activity — SpartanDAppV2
package.json
- Removed: “react-copy-to-clipboard”
src/components/Share/ShareLink.js
- Fixed copy function; changed to native js (removed library dep)
GitHub Activity — SpartanBlog
A true community project needs a lightweight news/updates source! Recent events moved this up the priority list; over the coming weeks this new blog will become Spartan Protocol’s official destination for news/announcements
- Built initial gatsby headless Ghost install with predefined default styling
- Setup hosted backend to feed the articles to the headless compile
- Automated the workflow compile + deploys
- Migrate all previous articles to the new backend (to be fed to the frontend via API)
- Fix all the formatting/image/embed issues in all the recent articles (clean up the older ones later on as a community effort)
- Overhaul the template files (posts, pages, index etc) to a more ‘spartan’ theme (see below screenshot)
- This is now ready for wider community contribution
Project Information
Official Links
- 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.
Engage with the community and contributors
Where to find out about all the latest updates or suggest improvements — get involved.
- Medium: https://medium.com/spartanprotocol
- Twitter: https://twitter.com/spartanprotocol
- Telegram Community: https://t.me/spartanprotocolorg
- Telegram Announcements: https://t.me/spartanprotocolann
- Community-Built Discord: https://discord.gg/wQggvntnGk
Community Bounty Wallet
Whilst there is no treasury nor contributor allocations, there was a public community bounty wallet set up a while ago to help handle donations from the community and other incentive programs (BNB from the Binance BUIDl program was sent here) which can be viewed here: