SpartanDev: 20SEP21 - 26SEP21
Public testnet is live & ready to go. Jump into the DApp and help with the final stage before mainnet v2!
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.
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.
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
- Added:
event Claimed(address indexed owner, address indexed poolAddress, uint amount);
for better subgraph positions tracking - Removed the unused
bool
return indepositForMember()
- Removed the unused
bool
return inclaimForMember()
& emit the newClaimed
event - Changed
getMemberLPWeight()
to use vault assets (curated pools) instead of bond-listed assets - Moved
burnBalance()
back to the DAO - Moved
moveBASEBalance()
back to the DAO - Added requirement for the address handed to
listBondAsset()
to be curated - Removed the unused
bool
return inclaim()
& added check to ensure only the DAO can call it direct (to prevent accidental unsynced proposal votes)
contracts/Dao.sol
- Changed some variables to
private
to save compile space - Changed
event DepositAsset
to hand in poolAddr & tokenAddr for better subgraph positions management - Added
event Harvest(address indexed owner, uint amount);
for better subgraph positions management - Changed
withdraw()
args around other way - Emit
Harvest
event inharvest()
- Moved back in the
burnBalance()
function - Moved back in the
moveBASEBalance()
function - Removed
require(param > 0)
fromnewParamProposal()
- Set
retire
to true on_moveDao()
- Added
require(param > 0)
in_changeCooloff()
- Added a
retireDao()
setter
contracts/Pool.sol
- Changed
event AddLiquidity
to hand in tokenAddr for better subgraph positions handling - Changed
event RemoveLiquidity
to hand in tokenAddr for better subgraph positions handling - Changed
event BurnSynth
to hand in synthAddr for better subgraph positions handling - Changed
event MintSynth
to hand in synthAddr for better subgraph positions handling - Changed
removeForMember(address member)
toremoveForMember(address recipient, address actualMember)
for better subgraph positions management - Changed
burnSynth(address member)
toburnSynth(addressrecipient, addressactualMember)
for better subgraph positions management
contracts/Router.sol
- Changed functions to suit any changed events elsewhere (see above)
contracts/Utils.sol
- Changed
getPoolData()
to return the pool's raw synthCap value (basis points) instead of handing back an amount in SPARTA
contracts/synthVault.sol
- Changed
_deposit()
to shift by10 seconds
instead ofminimumDepositTime
for better UX - Changed
harvestSingle()
to shift by10 seconds
instead ofminimumDepositTime
for better UX
GitHub Activity β Spartan DApp v2
Readme.md
- Brought across the updated readme to the main branch
public/index.html
- Added & updated the favicons
src/ABI/TN/*.json
- Updated all the ABIs for public testnet
src/Providers.js
- 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
- Changed some deps
- Changed the conditional compare to use BigNumber
isLessThan()
src/components/AssetSelect/AssetSelect.js
- Added an optional prop to trigger an action on the parent component on click of the assetSelect box
src/components/DataManager/DataManager.js
- Added
wallet.account
as a dep forcheckArraysNext()
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
- Changed
formatShortString()
to only run if characters > 15 - If the user's wallet is the entity for a txn; show 'Your Wallet' instead of the wallet's address
- Added some wording to make the txn info more clear
- Added logic to handle what 'type' of asset it is and show the icon accordingly (Tokens, LPs, synths)
- Added an
isLoading()
check to ensure data isn't shown before its ready
src/components/WalletSelect/Assets.js
- Hide $USD if no internal pricing is available (prevent confusion on the current basic mainnet)
- Added an
isLoading()
check for conditionally showing data when it is ready
src/components/WalletSelect/LPs.js
- Moved
getBondDetails()
&getDaoDetails()
to the parent component - Simplified
_getPool()
as the fallbackfalse
is handled in the helper - Added an
isLoading()
check for conditionally showing data when it is ready
src/components/WalletSelect/Synths.js
- Moved
getSynthDetails()
to the parent component - Added an
isLoading()
check for conditionally showing data when it is ready
src/components/WalletSelect/WalletSelect.js
- Removed the
isAppleDevice()
logic seeing as Apple has blocked that TrustWallet feature - Added an
activeTab
state - 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 - Added a
rankLoading()
check to make sure the rank is not shown before the data is ready - Made 'Loading' the fallback/default state of
rank
instead of0 || Peasant
- 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) - Added a
getTokenCount()
counter (with loading/spinner) - Added a
getLpsCount()
counter (with loading/spinner) - Added a
getSynthsCount()
counter (with loading/spinner) - Changed 'assets' to 'tokens'
- Use state to handle selected tab instead of
Tabs
keys
src/store/bond/*.js
- Moved multi-line code to single-line where possible
- Added
parseTxn()
to the bond txn actions - Changed the
initialState
tobool false
for the objects
src/store/dao/*.js
- Converted all txns to the new
parseTxn()
style - Changed the
initialState
tobool false
for the objects
src/store/pool/*.js
- Added
chainId
handed intogetTokenDetails()
for the newgetTwTokenLogo()
logic - Removed the old
trustWalletIndex
etc logic - Changed
synthCap
tosynthCapBPs
to make it more clear it's in basis points - Changed
newPool
to use genesis andoneWeek
variable to calculate whether the pool is innewPool
phase or not - Added
stirRate
andlastStirred
to the poolDetails object createPoolADD()
rewritten to get everything in single lines & changed to the new ΒparseTxn()
logic- Changed the
initialState
tobool false
for the objects
src/store/reserve/*.js
- Changed the
initialState
tobool false
for the objects
src/store/router/*.js
- Rewrote functions to get as many multi-line sections into single lines (code clarity)
- Converted all txns to the new
parseTxn()
style
src/store/sparta/*.js
- Rewrote functions to get as many multi-line sections into single lines (code clarity)
- Converted all txns to the new
parseTxn()
style - Changed the
initialState
tobool false
for the objects
src/store/synth/*.js
- Added
getSynthMemberDetails()
to get user's last deposit time - Rewrote functions to get as many multi-line sections into single lines (code clarity)
- Converted all txns to the new
parseTxn()
style - Changed the
initialState
tobool false
for the objects
src/store/utils/*.js
- Changed the
error
output back to standard - 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
- Converted all txns to the new
parseTxn()
style
src/utils/math/router.js
- Updated
stirCauldron()
calculations:
- Hardcoded 'week' changed to use the
oneWeek
variable in utils/web3 synthPoolSynthCap
handed in changed to wholesynthPool
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
- Added
handleWBNB()
to just do a simple check if the address is WBNB and change it to BNB if true (consistency) - Changed
getToken()
&getPool()
&getSynth()
&getDao()
&getBond()
to all look for a match in thetokenAddress || address
instead of justtokenAddress
to make them a little bit more smart/helpful
src/utils/web3.js
- Updated addresses
- Added a
oneWeek
variable for easier management of variables changing - Added
getTwAssetId()
to get the TrustWallet API formatted ID of an asset from it's tokenAddress - Added
getTwTokenInfo()
to get the token's info from the TrustWallet index/repo - Added
getTwTokenLogo()
to get the token's icon from the TrustWallet index/repo & fallback to our fallback icon if not available - Added rough
mergeAbis()
function to help with handling event parsing for the RecentTxns component (merges multiple ABIs into one 'master' ABI) parseTxnLogs()
- replaced any 'member' usage withtxn.from
so that the wallet that called the txn is used as themember
instead of themember
reported by the event (this works fine in the front end but is not possible in things like the subgraph)parseTxnLogs()
- added manual parsing logic for all transaction types
src/views/pages/Bond/Bond.js
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Bond/BondItem.js
- Added loading state when claiming a Bond position
src/views/pages/Dao/NewProposal.js
- Added loading state when submitting a new DAO proposal
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Dao/Overview.js
- Added loading state when Dao items are not yet loaded
src/views/pages/Dao/ProposalItem.js
- Added loading states for each type of txn
src/views/pages/Dao/components/AssetSelect.js
- Added filter to ensure only curated assets are shown for Bond-listing
src/views/pages/Donate/Overview.js
- Added loading states for donation txns
src/views/pages/Home/NewPool.js
- Added loading states when creating a pool
- Use the new trustwallet icon-get logic instead of the old one (see above)
- OnClear & onSubmit the confirm checks will clear/reset
src/views/pages/Home/Overview.js
- Added badge counters to the home/pools page (for each type)
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Home/PoolItem.js
- 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
- Added simple explainers & badges for each pool type (need someone to convert this into something more visually appealing)
src/views/pages/Pools/LiqAdd.js
- Added loading states for all txn types
- Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
- Changed hardcoded 'week' to use the new
oneWeek
variable instead
src/views/pages/Pools/LiqBond.js
- Added loading states for all txn types
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Pools/LiqRemove.js
- Added loading states for all txn types
- Changed hardcoded 'week' to use the new
oneWeek
variable instead
src/views/pages/Pools/Overview.js
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Swap/Swap.js
- Added loading states for all txn types
- Changed hardcoded 'week' to use the new
oneWeek
variable instead - Added dispatch to
getSynthGlobalDetails()
- Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
- Added baseCapped & synthCapped returns for the
checkValid()
function
src/views/pages/Swap/SwapPair.js
- Added
isLoading()
logic to ensure data is only shown when it is ready
src/views/pages/Synths/NewSynth.js
- Added loading states for all txn types
src/views/pages/Synths/Overview.js
- Added loading states for all txn types
- Added dispatch to
getSynthGlobalDetails()
- Added logic to clear the confirm checks whenever a significant change occurs (change tab etc)
- Added baseCapped & synthCapped returns for the
checkValid()
function
src/views/pages/Upgrade/Upgrade.js
- Added loading states for all txn types
src/views/pages/Vault/Components/DaoDepositModal.js
- Added loading states for all txn types
- Added logic to clear the confirm checks whenever a significant change occurs
- Added checks and actions to handle whether a user should harvest before depositing
src/views/pages/Vault/Components/SynthDepositModal.js
- Added loading states for all txn types
- Added logic to clear the confirm checks whenever a significant change occurs
- Added checks and actions to handle whether a user should harvest before depositing
src/views/pages/Vault/DaoVault.js
- Added loading states for all txn types
- Made the tile-heights static instead of dynamic to make the page a bit more balanced
- Refactored the 'item' logic into its own component (see next item)
src/views/pages/Vault/DaoVaultItem.js
- Created this child component to refactor the DaoVault code
src/views/pages/Vault/SynthVault.js
- Added loading states for all txn types
- Added dispatch for
getSynthMemberDetails()
- Made the tile-heights static instead of dynamic to make the page a bit more balanced
src/views/pages/Vault/SynthVaultItem.js
- Added loading states for all txn types
- Made the tile-heights static instead of dynamic to make the page a bit more balanced
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.β
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.
- 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