$11 000 000 USD





"At the end of 2020, Andre Cronje, a DeFi Architect and creator of Yearn Finance, presented a new experimental DeFi project called yCredit.Finance." "On the 1st January, Cronje announced the launch of tokenised yield credit via yCredit. As he no longer uses Twitter, this announcement was made with little fuss via a Medium post."


"This project is in beta. Use at your own risk."


"When Nour Haridy made a public announcement on Twitter, warning people to withdraw from the contracts, he was accused of clout chasing, and abandoning responsible disclosure in exchange for self-promotion."


"On January 2, 2021 (Beijing Time 07:25am), [the BlockSec team] monitoring system ThunderForecast reported a series of suspicious transactions towards the yCREDIT smart contract."


"The attack is due to the number of tokens minted is inconsistent with the intended one. As such, the attacker can get more numbers of yCREDIT tokens with lower price. Then these tokens can be sold to gain profits." "The vulnerable function is in the _deposit function of the StableYieldCredit contract."


"The attacker first transferred 1e-8 WBTC and 331.335 yCredit tokens to the WBTC-yCREDIT Pair pool. Then the attacker deposited 0.5 WBTC to the StableYieldCredit contract to launch the attack."


"Specifically, the _value is calculated using the amount (0.5) of the token (0x2260fac5e5542a773aa44fbcfedf7c193bc2c599 - WBTC) based on the price oracle provider ChainLink (line 480, _value is 1466786010075). The intention is to calculate the value of the deposited WBTC in USD. Then the contract will transfer the number of yCREDIT tokens (_value - fee) to the one who deposited the WBTC (the attacker). That's because the value of yCREDIT equals one USD (as designed by the system). Everything is fine except the attacker loses a small amount of fee."


"Moreover, the contract will add the deposited WBTC to the WBTC-yCREDIT Pair pool. That’s because if the deposited WBTC is locked into the contract, it will lose liquidity. As such, it first calculated the value of the token pair (WBTC to yCREDIT) that will be put into the pool. This value is calculated using the function _addLiquidity. Basically, it is calculated based on the existing reserves inside the pool. Since the pool only has 1e-8 WBTC and 331.335 yCREDIT tokens, the amountA calculated is 44 (amountB is 1466786010075). That means the attacker only spends 44e-8 WBTC (line 485) and gets 14667.86010075 - fee = 14594.52080025 yCREDIT tokens (line 493). At the same time, there is a small number of WBTC ( 1e-8 + 44e-8) and ( 331.335 + 14667.86010075) yCREDIT tokens leaving in the pool."


"To get profits, the attacker can simply trade the gained 14594.52080025 yCREDIT tokens in exchanges. Interestingly, the process to gain profits in this transaction is far more complicated than necessary. We have also observed a clever attacking strategy in other transactions."


"The contract has been redeployed, clout and cash has been redistributed, and we move on." "There is an new smart contract that fixes the vulnerability."

YCredit Finance was launched as a test smart contract, where word quickly spread, even though it was not announced in any official channels.


The smart contract had an exploit which allowed the effective minting of additional tokens, causing a massive price drop.


The contract was ultimately redeployed in the future, however those affected do not appear to have received any consideration.

Sources And Further Reading

 For questions or enquiries, email info@quadrigainitiative.com.

Get Social

  • email
  • reddit
  • telegram
  • Twitter

© 2021 Quadriga Initiative. Your use of this site/service accepts the Terms of Use and Privacy Policy. This site is not associated with Ernst & Young, Miller Thompson, or the Official Committee of Affected Users. Hosted in Canada by HosterBox.