Yearnspace Rug Pull

Reported loss $34K
Ethereum
Rugpull

What happened

Yearnspace (YFS) is an ERC20 on Ethereum whose mint function has no supply cap and is open to any address that the deployer, as governance, adds to the minters list. De.Fi's REKT database lists the incident as an exit scam / rug pull in which the deployer added itself as a minter, minted 15,000 YFS in two calls, swapped the tokens for ETH in 38 transactions to take 58 ETH, split that ETH among external wallets, and then took down the website and deleted the Twitter account. Etherscan confirms the deployer address 0xaC0bA8FA…c8Dd0D called addMinter at 14:11:21 UTC on 2020-11-14 (transaction 0xb3b88155…e4583f), twelve minutes after deploying the token, and minted 10,000 YFS to itself at 14:12:53 UTC the same day (0x95aac0cc…b34183) and a further 5,000 YFS at 18:11:28 UTC on 2020-12-04 (0xaa5b1712…d29eeb).

How it happened

  1. The constructor makes the deployer the governor: constructor () public ERC20Detailed("Yearnspace", "YFS", 18) { governance = msg.sender; }.
  2. Governance controls the minter list: function addMinter(address _minter) public { require(msg.sender == governance, "!governance"); minters[_minter] = true; }. setGovernance can hand that role to any address, and no function limits who is added.
  3. Any listed minter can create tokens without limit: function mint(address account, uint amount) public { require(minters[msg.sender], "!minter"); _mint(account, amount); }, and _mint simply does _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); with no cap. Minted tokens do not debit any holder's balance; they add new, unbacked tokens that dilute everyone else's share.
  4. What happened, per Etherscan: 12 minutes after deployment the deployer called addMinter, and a mint of 10,000 YFS to the deployer address succeeded about 90 seconds later. Because mint requires minters[msg.sender], the successful call shows the deployer was a minter. A second mint of 5,000 YFS to the deployer followed on 2020-12-04.
  5. According to De.Fi's REKT database, the deployer then exchanged the YFS for ETH in 38 transactions, took 58 ETH, and split it among external wallets; the website went down and the Twitter account was deleted. The opened sources do not include those swap transactions.

Protocol details

Classification Yield Aggregator
Protocol Type Exit Scam/Rugpull
Affected asset / contract YFS
Protocol links Website @YEARNSPACE

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.