02-16-2023, 11:45 AM
(This post was last modified: 02-20-2023, 06:20 AM by _blockchainer_.)
Spot the vuln - Challenge 1
|
02-16-2023, 12:18 PM
function _approve(address owner, address spender, uint256 amount) internal virtual {
  require(spender != address(0), "ERC20: approve from the zero address");   require(owner != address(0), "ERC20: approve to the zero address");   _allowances[owner][spender] += amount;   emit Approval(owner, spender, amount); }
02-16-2023, 12:21 PM
The changes I made:
1. Added a comma between spender and uint256 amount in the function signature. 2.Changed the address 6 to 0, which is the correct address for the zero address. 3.Removed the unnecessary single quotes around spender and uint256. 4. Fixed the indexing of _allowances by removing the space between [owner] and [spender].
02-17-2023, 06:38 AM
(02-16-2023, 12:21 PM)BULL Wrote: The changes I made: sorry not, I don't even understand all of this claims. can you please elaborate.
02-17-2023, 06:48 AM
(02-16-2023, 12:18 PM)BULL Wrote: function _approve(address owner, address spender, uint256 amount) internal virtual { This is same code ,I don't see a difference. |
« Next Oldest | Next Newest »
|
Users browsing this thread: |
5 Guest(s) |