Skip to content

Instantly share code, notes, and snippets.

@0xAnon101
Last active August 5, 2022 15:08
Show Gist options
  • Select an option

  • Save 0xAnon101/ac15a0a57b003c20c2ba361cc59bf78f to your computer and use it in GitHub Desktop.

Select an option

Save 0xAnon101/ac15a0a57b003c20c2ba361cc59bf78f to your computer and use it in GitHub Desktop.
DVD Unstoppable #1 - a()
// why use deposit tokens to get the balance?
function depositTokens(uint256 amount) external nonReentrant {
require(amount > 0, "Must deposit at least one token");
// Transfer token from sender. Sender must have first approved them.
damnValuableToken.transferFrom(msg.sender, address(this), amount);
poolBalance = poolBalance + amount;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment